Skip to content

Commit 5d352b8

Browse files
committed
add test
1 parent a2a1c10 commit 5d352b8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/TwigComponent/tests/Integration/ComponentExtensionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ public function testComponentWithClassMerge(): void
263263
$this->assertStringContainsString('class="alert alert-red alert-lg font-semibold rounded-md dark:bg-gray-600 flex p-4"', $output);
264264
}
265265

266+
public function testComponentWithPropsFromTemplateAndClass(): void
267+
{
268+
$output = self::getContainer()->get(Environment::class)->render('component_with_props_from_template_and_class.html.twig');
269+
270+
$this->assertStringContainsString('data-color=\'success\'', $output);
271+
$this->assertStringContainsString('data-size=\'lg\'', $output);
272+
$this->assertStringContainsString('Congrats !', $output);
273+
}
274+
266275
private function renderComponent(string $name, array $data = []): string
267276
{
268277
return self::getContainer()->get(Environment::class)->render('render_component.html.twig', [

0 commit comments

Comments
 (0)