@@ -33,15 +33,15 @@ public function testRenderScriptTags()
33
33
->willReturnCallback (function ($ path ) {
34
34
return 'http://localhost:8080 ' .$ path ;
35
35
});
36
- $ renderer = new TagRenderer ($ entrypointCollection , $ packages , ' anonymous ' );
36
+ $ renderer = new TagRenderer ($ entrypointCollection , $ packages , [ ' crossorigin ' => ' anonymous '] );
37
37
38
38
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , 'custom_package ' );
39
39
$ this ->assertContains (
40
- '<script src="http://localhost:8080/build/file1.js"></script> ' ,
40
+ '<script src="http://localhost:8080/build/file1.js" crossorigin="anonymous" ></script> ' ,
41
41
$ output
42
42
);
43
43
$ this ->assertContains (
44
- '<script src="http://localhost:8080/build/file2.js"></script> ' ,
44
+ '<script src="http://localhost:8080/build/file2.js" crossorigin="anonymous" ></script> ' ,
45
45
$ output
46
46
);
47
47
}
@@ -64,11 +64,11 @@ public function testRenderScriptTagsWithBadFilename()
64
64
->willReturnCallback (function ($ path ) {
65
65
return 'http://localhost:8080 ' .$ path ;
66
66
});
67
- $ renderer = new TagRenderer ($ entrypointCollection , $ packages , ' anonymous ' );
67
+ $ renderer = new TagRenderer ($ entrypointCollection , $ packages , [ ' crossorigin ' => ' anonymous '] );
68
68
69
69
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , 'custom_package ' );
70
70
$ this ->assertContains (
71
- '<script src="http://localhost:8080/build/file<"bad_chars.js"></script> ' ,
71
+ '<script src="http://localhost:8080/build/file<"bad_chars.js" crossorigin="anonymous" ></script> ' ,
72
72
$ output
73
73
);
74
74
}
@@ -110,21 +110,21 @@ public function testRenderScriptTagsWithinAnEntryPointCollection()
110
110
->willReturnCallback (function ($ path ) {
111
111
return 'http://localhost:8080 ' .$ path ;
112
112
});
113
- $ renderer = new TagRenderer ($ entrypointCollection , $ packages , ' anonymous ' );
113
+ $ renderer = new TagRenderer ($ entrypointCollection , $ packages , [ ' crossorigin ' => ' anonymous '] );
114
114
115
115
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , 'custom_package ' );
116
116
$ this ->assertContains (
117
- '<script src="http://localhost:8080/build/file1.js"></script> ' ,
117
+ '<script src="http://localhost:8080/build/file1.js" crossorigin="anonymous" ></script> ' ,
118
118
$ output
119
119
);
120
120
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , null , 'second ' );
121
121
$ this ->assertContains (
122
- '<script src="http://localhost:8080/build/file2.js"></script> ' ,
122
+ '<script src="http://localhost:8080/build/file2.js" crossorigin="anonymous" ></script> ' ,
123
123
$ output
124
124
);
125
125
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , 'specific_package ' , 'third ' );
126
126
$ this ->assertContains (
127
- '<script src="http://localhost:8080/build/file3.js"></script> ' ,
127
+ '<script src="http://localhost:8080/build/file3.js" crossorigin="anonymous" ></script> ' ,
128
128
$ output
129
129
);
130
130
}
@@ -160,7 +160,7 @@ public function testRenderScriptTagsWithHashes()
160
160
->willReturnCallback (function ($ path ) {
161
161
return 'http://localhost:8080 ' . $ path ;
162
162
});
163
- $ renderer = new TagRenderer ($ entrypointCollection , $ packages , ' anonymous ' );
163
+ $ renderer = new TagRenderer ($ entrypointCollection , $ packages , [ ' crossorigin ' => ' anonymous '] );
164
164
165
165
$ output = $ renderer ->renderWebpackScriptTags ('my_entry ' , 'custom_package ' );
166
166
$ this ->assertContains (
0 commit comments