Skip to content

Commit de52996

Browse files
committed
add more tests
1 parent b9bfcfc commit de52996

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tests/TagEngineTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,32 @@ public function testTagWithAttributeSelfClosing(): void
8282
$this->assertSame($expected, $result);
8383
}
8484

85+
/**
86+
* Test multiple self-closing tag variants
87+
*
88+
* @return void
89+
*/
90+
public function testMultipleTagsWithAttributeSelfClosing(): void
91+
{
92+
$element = '<c-youtube src="RLdsCL4RDf8" /><c-youtube src="RLdsCL4RDf8" />';
93+
$tagEngine = new TagEngine([
94+
'tag_directories' => [__DIR__ . DIRECTORY_SEPARATOR . 'Tags' . DIRECTORY_SEPARATOR],
95+
]);
96+
$result = $tagEngine->parse($element);
97+
$expected = <<<HTML
98+
<iframe width="560" height="315"
99+
src="https://www.youtube.com/embed/RLdsCL4RDf8"
100+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
101+
allowfullscreen>
102+
</iframe> <iframe width="560" height="315"
103+
src="https://www.youtube.com/embed/RLdsCL4RDf8"
104+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
105+
allowfullscreen>
106+
</iframe>
107+
HTML;
108+
$this->assertSame($expected, $result);
109+
}
110+
85111
/**
86112
* Test tags work with multiple attributes
87113
*

0 commit comments

Comments
 (0)