Skip to content

Commit d0a316b

Browse files
committed
add test to prove html attribute escaping
1 parent a65be0b commit d0a316b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Icons/tests/Integration/Twig/UXIconExtensionTest.php renamed to src/Icons/tests/Integration/RenderIconsInTwigTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\UX\Icons\Tests\Integration\Twig;
12+
namespace Symfony\UX\Icons\Tests\Integration;
1313

1414
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1515
use Twig\Environment;
1616

1717
/**
1818
* @author Kevin Bond <[email protected]>
1919
*/
20-
final class UXIconExtensionTest extends KernelTestCase
20+
final class RenderIconsInTwigTest extends KernelTestCase
2121
{
2222
public function testRenderIcons(): void
2323
{
2424
$output = self::getContainer()->get(Environment::class)->createTemplate(<<<TWIG
2525
<ul class="svg">
2626
<li id="first">{{ ux_icon('user', {class: 'h-6 w-6'}) }}</li>
2727
<li id="second">{{ ux_icon('user') }}</li>
28-
<li id="third">{{ ux_icon('sub:check') }}</li>
28+
<li id="third">{{ ux_icon('sub:check', {'data-action': 'string "with" quotes'}) }}</li>
2929
<li id="fifth"><twig:Icon name="user" class="h-6 w-6" /></li>
3030
<li id="sixth"><twig:Icon name="sub:check" /></li>
3131
</ul>
@@ -36,7 +36,7 @@ public function testRenderIcons(): void
3636
<ul class="svg">
3737
<li id="first"><svg viewBox="0 0 24 24" fill="currentColor" class="h-6 w-6"><path fill-rule="evenodd" d="M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z" clip-rule="evenodd"></path></svg></li>
3838
<li id="second"><svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z" clip-rule="evenodd"></path></svg></li>
39-
<li id="third"><svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z" clip-rule="evenodd"></path></svg></li>
39+
<li id="third"><svg viewBox="0 0 24 24" fill="currentColor" data-action="string &quot;with&quot; quotes"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z" clip-rule="evenodd"></path></svg></li>
4040
<li id="fifth"><svg viewBox="0 0 24 24" fill="currentColor" class="h-6 w-6"><path fill-rule="evenodd" d="M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z" clip-rule="evenodd"></path></svg></li>
4141
<li id="sixth"><svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z" clip-rule="evenodd"></path></svg></li>
4242
</ul>

0 commit comments

Comments
 (0)