Skip to content

Commit 34ccb3a

Browse files
committed
Add test
1 parent 744e0e6 commit 34ccb3a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Dto/StimulusControllersDto.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\WebpackEncoreBundle\Dto;
1313

14+
use Twig\Markup;
15+
1416
final class StimulusControllersDto extends AbstractStimulusDto
1517
{
1618
private $controllers = [];

tests/Dto/StimulusControllersDtoTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,20 @@ public function testToArrayNoEscapingAttributeValues(): void
5151
$attributesArray
5252
);
5353
}
54+
55+
public function testAddOutlet(): void
56+
{
57+
$this->stimulusControllersDto->addController('foo', ['bar' => '"'], ['baz' => '"']);
58+
$this->stimulusControllersDto->addOutlet('outlet-name', '"');
59+
$attributesArray = $this->stimulusControllersDto->toArray();
60+
self::assertSame(
61+
[
62+
'data-controller' => 'foo',
63+
'data-foo-bar-value' => '"',
64+
'data-foo-baz-class' => '"',
65+
'data-foo-outlet-name-outlet' => '"',
66+
],
67+
$attributesArray
68+
);
69+
}
5470
}

0 commit comments

Comments
 (0)