Skip to content

Commit 1551c8b

Browse files
committed
Add test
1 parent 744e0e6 commit 1551c8b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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)