Skip to content

Commit 42585c1

Browse files
author
Natalia Momotenko
committed
MAGETWO-33407: Cover MAGETWO-31855 changes by static tests
- Merge remote-tracking branch 'origin/MAGETWO-33407' into UI Conflicts: app/code/Magento/GoogleAdwords/view/frontend/templates/code.phtml
2 parents 188990d + c5b78d3 commit 42585c1

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

app/code/Magento/GoogleAdwords/view/frontend/templates/code.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
var google_conversion_value = <?php echo $block->getHelper()->getConversionValue() ?>;
1919
/* ]]> */
2020
</script>
21-
<script type="text/javascript" src="<?php echo $block->getHelper()->getConversionJsSrc()?>"></script>
21+
<script src="<?php echo $block->getHelper()->getConversionJsSrc()?>"></script>
2222
<noscript>
2323
<div style="display:inline;">
2424
<img height="1" width="1" style="border-style:none;" alt=""

dev/tests/static/testsuite/Magento/Test/Legacy/PhtmlTemplateTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,25 @@ function ($file) {
5656
\Magento\Framework\Test\Utility\Files::init()->getPhtmlFiles()
5757
);
5858
}
59+
60+
public function testObsoleteJavascriptAttributeType()
61+
{
62+
$invoker = new \Magento\Framework\Test\Utility\AggregateInvoker($this);
63+
$invoker(
64+
/**
65+
* "text/javascript" type attribute in not obligatory to use in templates due to HTML5 standards.
66+
* For more details please go to "http://www.w3.org/TR/html5/scripting-1.html".
67+
*
68+
* @param string $file
69+
*/
70+
function ($file) {
71+
$this->assertNotRegexp(
72+
'/type="text\/javascript"/',
73+
file_get_contents($file),
74+
'Please do not use "text/javascript" type attribute.'
75+
);
76+
},
77+
\Magento\Framework\Test\Utility\Files::init()->getPhtmlFiles()
78+
);
79+
}
5980
}

0 commit comments

Comments
 (0)