@@ -36,7 +36,26 @@ public function testTagWithAttribute(): void
36
36
<iframe width="560" height="315"
37
37
src="https://www.youtube.com/embed/RLdsCL4RDf8"
38
38
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
40
59
</iframe>
41
60
HTML ;
42
61
$ this ->assertSame ($ expected , $ result );
@@ -55,7 +74,7 @@ public function testTagWithAttributeSelfClosing(): void
55
74
<iframe width="560" height="315"
56
75
src="https://www.youtube.com/embed/RLdsCL4RDf8"
57
76
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
58
- allowfullscreen>
77
+ allowfullscreen
59
78
</iframe>
60
79
HTML ;
61
80
$ this ->assertSame ($ expected , $ result );
@@ -74,11 +93,11 @@ public function testMultipleTagsWithAttributeSelfClosing(): void
74
93
<iframe width="560" height="315"
75
94
src="https://www.youtube.com/embed/RLdsCL4RDf8"
76
95
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
77
- allowfullscreen>
96
+ allowfullscreen
78
97
</iframe> <iframe width="560" height="315"
79
98
src="https://www.youtube.com/embed/RLdsCL4RDf8"
80
99
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
81
- allowfullscreen>
100
+ allowfullscreen
82
101
</iframe>
83
102
HTML ;
84
103
$ this ->assertSame ($ expected , $ result );
@@ -182,7 +201,7 @@ public function testTagWithAttributeAndNormalHTML(): void
182
201
<iframe width="560" height="315"
183
202
src="https://www.youtube.com/embed/RLdsCL4RDf8"
184
203
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
185
- allowfullscreen>
204
+ allowfullscreen
186
205
</iframe><div>Test</div>
187
206
HTML ;
188
207
$ this ->assertSame ($ expected , $ result );
@@ -201,7 +220,7 @@ public function testTagWithAttributeSelfClosingAndNormalHTML(): void
201
220
<iframe width="560" height="315"
202
221
src="https://www.youtube.com/embed/RLdsCL4RDf8"
203
222
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
204
- allowfullscreen>
223
+ allowfullscreen
205
224
</iframe><div>Test</div><input type="text"/>
206
225
HTML ;
207
226
$ this ->assertSame ($ expected , $ result );
@@ -254,7 +273,7 @@ public function testWithDivWrapped(): void
254
273
<iframe width="560" height="315"
255
274
src="https://www.youtube.com/embed/RLdsCL4RDf8"
256
275
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
257
- allowfullscreen>
276
+ allowfullscreen
258
277
</iframe>
259
278
</div>
260
279
HTML ;
0 commit comments