Skip to content

Commit a4863c6

Browse files
committed
Add tests to demonstrate bugs
1 parent 2c19804 commit a4863c6

File tree

7 files changed

+61
-1
lines changed

7 files changed

+61
-1
lines changed

Magento2/Tests/Legacy/PhtmlTemplateUnitTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public function getWarningList($testFile = '')
5959
9 => 1,
6060
20 => 1,
6161
23 => 1,
62-
27 => 1
62+
27 => 1,
63+
44 => 1,
64+
45 => 1,
65+
46 => 1,
6366
];
6467
}
6568
if ($testFile === 'PhtmlTemplateUnitTest.3.phtml') {
@@ -68,6 +71,9 @@ public function getWarningList($testFile = '')
6871
20 => 1,
6972
23 => 1,
7073
27 => 1,
74+
44 => 1,
75+
45 => 1,
76+
46 => 1,
7177
];
7278
}
7379
return [];

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/adminhtml/templates/PhtmlTemplateUnitTest.3.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script type='text/javascript'></script>
45+
<script type="TEXT/JAVASCRIPT"></script>
46+
<SCRIPT TYPE="text/javascript"></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/adminhtml/templates/PhtmlTemplateUnitTest.3.phtml.fixed

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script></script>
45+
<script></script>
46+
<SCRIPT></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/base/templates/PhtmlTemplateUnitTest.1.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script type='text/javascript'></script>
45+
<script type="TEXT/JAVASCRIPT"></script>
46+
<SCRIPT TYPE="text/javascript"></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/base/templates/PhtmlTemplateUnitTest.1.phtml.fixed

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script></script>
45+
<script></script>
46+
<SCRIPT></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/frontend/templates/PhtmlTemplateUnitTest.2.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script type='text/javascript'></script>
45+
<script type="TEXT/JAVASCRIPT"></script>
46+
<SCRIPT TYPE="text/javascript"></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

Magento2/Tests/Legacy/_files/PhtmlTemplateUnitTest/view/frontend/templates/PhtmlTemplateUnitTest.2.phtml.fixed

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ $this->helper();
3838
?>
3939
<script type="jquery/ui">
4040
</script>
41+
42+
<p>This sniff should remove the any <code> type="text/javascript" </code> attributes from &lt;script&gt; tags, but not from elsewhere in the document.</p>
43+
44+
<script></script>
45+
<script></script>
46+
<SCRIPT></SCRIPT>
47+
<script>
48+
const type="text/javascript";
49+
</script>

0 commit comments

Comments
 (0)