*/ private array $functions; protected function setUp(): void { $extension = new PostExtension(); $this->functions = []; foreach ($extension->getFunctions() as $function) { $this->functions[$function->getName()] = $function; } } public function testPostUrlUsesStoredSlug(): void { $post = new Post(1, 'Mon article', '

Contenu

', 'mon-article-2'); self::assertSame('/article/mon-article-2', $this->call('post_url', $post)); } public function testPostExcerptKeepsSafeTagsAndTruncatesHtml(): void { $html = '

Bonjour monde ' . str_repeat('x', 30) . '

'; $post = new Post(1, 'Titre', $html, 'titre'); $excerpt = $this->call('post_excerpt', $post, 20); self::assertStringContainsString('Bonjour', $excerpt); self::assertStringContainsString('', $excerpt); self::assertStringNotContainsString('