Publication initiale de RelaisSMS : documentation et sources nettoyees
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Services\Sms\OvhShortCodeMessage;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OvhShortCodeMessageTest extends TestCase
|
||||
{
|
||||
#[DataProvider('messages')]
|
||||
public function test_it_removes_links_and_preserves_useful_text(string $input, string $expected): void
|
||||
{
|
||||
$this->assertSame($expected, (new OvhShortCodeMessage)->prepare($input));
|
||||
}
|
||||
|
||||
public static function messages(): array
|
||||
{
|
||||
return [
|
||||
'production reminder' => ["Rappel : Réunion Communication\n30/09/2026 10:00\nParticiper à la réunion Zoom https://us06web.zoom.us/j/12345 ID de réunion: 123 456", "Rappel : Réunion Communication\n30/09/2026 10:00\nParticiper à la réunion Zoom ID de réunion: 123 456"],
|
||||
'schemes and www' => ['Voir HTTPS://example.org/x?a=b et www.example.fr/test merci', 'Voir et merci'],
|
||||
'bare domain' => ['Zoom zoom.us/j/123 puis exemple.fr', 'Zoom puis'],
|
||||
'markdown' => ['Rejoindre [la réunion](https://zoom.us/j/123)', 'Rejoindre la réunion'],
|
||||
'html' => ['Rejoindre <a href="https://zoom.us/j/123">la réunion</a>', 'Rejoindre la réunion'],
|
||||
'email phones and date' => ['Contact prenom.nom@example.fr +33 6 12 34 56 78 le 30.09.2026 à 10:00', 'Contact prenom.nom@example.fr +33 6 12 34 56 78 le 30.09.2026 à 10:00'],
|
||||
'url only' => ['https://example.org', ''],
|
||||
'unicode domain' => ['Voir https://exemple.fr/été et réunion.fr/a', 'Voir et'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user