File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
app/code/Magento/GoogleAdwords/view/frontend/templates
dev/tests/static/testsuite/Magento/Test/Legacy Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 18
18
var google_conversion_value = <?php echo $ this ->getHelper ()->getConversionValue () ?> ;
19
19
/* ]]> */
20
20
</script>
21
- <script type="text/javascript" src="<?php echo $ this ->getHelper ()->getConversionJsSrc ()?> "></script>
21
+ <script src="<?php echo $ this ->getHelper ()->getConversionJsSrc ()?> "></script>
22
22
<noscript>
23
23
<div style="display:inline;">
24
24
<img height="1" width="1" style="border-style:none;" alt=""
Original file line number Diff line number Diff line change @@ -35,4 +35,31 @@ function ($file) {
35
35
\Magento \Framework \Test \Utility \Files::init ()->getPhtmlFiles ()
36
36
);
37
37
}
38
+
39
+ public function testObsoleteJavascriptAttributeType ()
40
+ {
41
+ $ invoker = new \Magento \Framework \Test \Utility \AggregateInvoker ($ this );
42
+ $ invoker (
43
+ /**
44
+ * Test usage of protected and private methods and variables in template
45
+ *
46
+ * According to naming convention (B5.8, B6.2) all class members
47
+ * in protected or private scope should be prefixed with underscore.
48
+ * Member variables declared "public" should never start with an underscore.
49
+ * Access to protected and private members of Block class is obsolete in phtml templates
50
+ * since introduction of multiple template engines support
51
+ *
52
+ * @param string $file
53
+ */
54
+ function ($ file ) {
55
+ $ this ->assertNotRegexp (
56
+ '/type="text\/javascript"/ ' ,
57
+ file_get_contents ($ file ),
58
+ 'Please do not use "text/javascript" type attribute due to HTML5 standards. ' .
59
+ ' For more details please go to "http://www.w3.org/TR/html5/scripting-1.html". '
60
+ );
61
+ },
62
+ \Magento \Framework \Test \Utility \Files::init ()->getPhtmlFiles ()
63
+ );
64
+ }
38
65
}
You can’t perform that action at this time.
0 commit comments