MNT Test for customScript sri attributes appended
This commit is contained in:
parent
33569f2dc2
commit
6e89070490
|
@ -1403,6 +1403,7 @@ EOS
|
|||
$this->setupRequirements($backend);
|
||||
|
||||
$backend->javascript('javascript/RequirementsTest_a.js', ['integrity' => 'abc', 'crossorigin' => 'use-credentials']);
|
||||
$backend->customScript("//TEST", null, ['type' => 'module', 'crossorigin' => 'anonymous']);
|
||||
$backend->css('css/RequirementsTest_a.css', null, ['integrity' => 'def', 'crossorigin' => 'anonymous']);
|
||||
$html = $backend->includeInHTML(self::$html_template);
|
||||
|
||||
|
@ -1413,6 +1414,13 @@ EOS
|
|||
'javascript has correct sri attributes'
|
||||
);
|
||||
|
||||
/* Custom Javascript has correct attribute */
|
||||
$this->assertMatchesRegularExpression(
|
||||
'#<script type="module" crossorigin="anonymous"#',
|
||||
$html,
|
||||
'custom javascript has correct sri attributes'
|
||||
);
|
||||
|
||||
/* CSS has correct attributes */
|
||||
$this->assertMatchesRegularExpression(
|
||||
'#<link .*href=".*/RequirementsTest_a\.css.*" integrity="def" crossorigin="anonymous"#',
|
||||
|
|
Loading…
Reference in New Issue