@@ -36,7 +36,26 @@ public function testTagWithAttribute(): void
3636 <iframe width="560" height="315"
3737 src="https://www.youtube.com/embed/RLdsCL4RDf8"
3838 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
39- allowfullscreen>
39+ allowfullscreen
40+ </iframe>
41+ HTML ;
42+ $ this ->assertSame ($ expected , $ result );
43+ }
44+
45+ /**
46+ * Test a tag with a longer attribute
47+ *
48+ * @return void
49+ */
50+ public function testTagWithLongerAttribute (): void
51+ {
52+ $ element = '<c-youtube src="RLdsCL4RDf8" data-test-something="test" /> ' ;
53+ $ result = $ this ->tagEngine ->parse ($ element );
54+ $ expected = <<<HTML
55+ <iframe width="560" height="315" test
56+ src="https://www.youtube.com/embed/RLdsCL4RDf8"
57+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
58+ allowfullscreen
4059 </iframe>
4160HTML ;
4261 $ this ->assertSame ($ expected , $ result );
@@ -55,7 +74,7 @@ public function testTagWithAttributeSelfClosing(): void
5574 <iframe width="560" height="315"
5675 src="https://www.youtube.com/embed/RLdsCL4RDf8"
5776 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
58- allowfullscreen>
77+ allowfullscreen
5978 </iframe>
6079HTML ;
6180 $ this ->assertSame ($ expected , $ result );
@@ -74,11 +93,11 @@ public function testMultipleTagsWithAttributeSelfClosing(): void
7493 <iframe width="560" height="315"
7594 src="https://www.youtube.com/embed/RLdsCL4RDf8"
7695 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
77- allowfullscreen>
96+ allowfullscreen
7897 </iframe> <iframe width="560" height="315"
7998 src="https://www.youtube.com/embed/RLdsCL4RDf8"
8099 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
81- allowfullscreen>
100+ allowfullscreen
82101 </iframe>
83102HTML ;
84103 $ this ->assertSame ($ expected , $ result );
@@ -182,7 +201,7 @@ public function testTagWithAttributeAndNormalHTML(): void
182201 <iframe width="560" height="315"
183202 src="https://www.youtube.com/embed/RLdsCL4RDf8"
184203 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
185- allowfullscreen>
204+ allowfullscreen
186205 </iframe><div>Test</div>
187206HTML ;
188207 $ this ->assertSame ($ expected , $ result );
@@ -201,7 +220,7 @@ public function testTagWithAttributeSelfClosingAndNormalHTML(): void
201220 <iframe width="560" height="315"
202221 src="https://www.youtube.com/embed/RLdsCL4RDf8"
203222 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
204- allowfullscreen>
223+ allowfullscreen
205224 </iframe><div>Test</div><input type="text"/>
206225HTML ;
207226 $ this ->assertSame ($ expected , $ result );
@@ -254,7 +273,7 @@ public function testWithDivWrapped(): void
254273 <iframe width="560" height="315"
255274 src="https://www.youtube.com/embed/RLdsCL4RDf8"
256275 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
257- allowfullscreen>
276+ allowfullscreen
258277 </iframe>
259278 </div>
260279HTML ;
0 commit comments