Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Feb 9, 2025
1 parent 75b284e commit eab66b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Unit/Twig/DataTableExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ public function testSetDataTableThemesWithOnly(): void
$this->assertEquals(['bar'], $view->vars['themes']);
}

public function testRenderThemeBlockRendersFirstOccurrence(): void
public function testRenderThemeBlockRendersLastOccurrence(): void
{
$environment = new Environment(new ArrayLoader([
'base.html.twig' => '',
// This theme contains the block, and is the first occurrence, so it should be rendered.
// This theme contains the block, and is the first occurrence.
'bootstrap_5.html.twig' => <<<TWIG
{% block content -%}
Hello from bootstrap_5.html.twig
{%- endblock %}
TWIG,
// This theme contains the block, but is second occurrence.
// This theme contains the block, but is second occurrence, so it overrides the Bootstrap 5.
'tabler.html.twig' => <<<TWIG
{% block content -%}
Hello from tabler.html.twig
Expand All @@ -63,7 +63,7 @@ public function testRenderThemeBlockRendersFirstOccurrence(): void
blockName: 'content',
);

$this->assertEquals('Hello from bootstrap_5.html.twig', $html);
$this->assertEquals('Hello from tabler.html.twig', $html);
}

public function testRenderThemeBlockThrowsExceptionOnMissingBlock(): void
Expand Down

0 comments on commit eab66b6

Please sign in to comment.