Working state

This commit is contained in:
julien
2026-03-16 08:50:42 +01:00
parent 81200f81cd
commit b5a728e669
7 changed files with 128 additions and 4 deletions

View File

@@ -59,6 +59,21 @@ final class PostExtensionTest extends TestCase
self::assertNull($this->call('post_thumbnail', $post));
}
public function testPostExcerptReturnsHtmlUnchangedWhenContentIsShortEnough(): void
{
$post = new Post(4, 'Titre', '<p><strong>Bonjour</strong> monde</p>', 'titre-4');
self::assertSame('<strong>Bonjour</strong> monde', $this->call('post_excerpt', $post, 50));
}
public function testPostInitialsFallsBackToFirstRawCharacterWhenOnlyStopWordsRemain(): void
{
$post = new Post(5, 'de la', '<p>Contenu</p>', 'slug-5');
self::assertSame('D', $this->call('post_initials', $post));
}
public function testPostInitialsUseMeaningfulWordsAndFallback(): void
{
$post = new Post(1, 'Article de Blog', '<p>Contenu</p>', 'slug');