mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Set nonce style on unit tests
This commit is contained in:
parent
e5d0400596
commit
b1b61f866e
@ -73,6 +73,7 @@ class SimpleResourceURLGeneratorTest extends SapphireTest
|
||||
{
|
||||
/** @var SimpleResourceURLGenerator $generator */
|
||||
$generator = Injector::inst()->get(ResourceURLGenerator::class);
|
||||
$generator->setNonceStyle('mtime');
|
||||
$mtime = filemtime(
|
||||
__DIR__ . '/SimpleResourceURLGeneratorTest/_fakewebroot/vendor/silverstripe/mymodule/client/style.css'
|
||||
);
|
||||
@ -86,6 +87,7 @@ class SimpleResourceURLGeneratorTest extends SapphireTest
|
||||
{
|
||||
/** @var SimpleResourceURLGenerator $generator */
|
||||
$generator = Injector::inst()->get(ResourceURLGenerator::class);
|
||||
$generator->setNonceStyle('mtime');
|
||||
$mtime = filemtime(
|
||||
__DIR__ . '/SimpleResourceURLGeneratorTest/_fakewebroot/public/basemodule/css/style.css'
|
||||
);
|
||||
@ -109,6 +111,7 @@ class SimpleResourceURLGeneratorTest extends SapphireTest
|
||||
{
|
||||
/** @var SimpleResourceURLGenerator $generator */
|
||||
$generator = Injector::inst()->get(ResourceURLGenerator::class);
|
||||
$generator->setNonceStyle('mtime');
|
||||
$module = new Module(
|
||||
__DIR__ . '/SimpleResourceURLGeneratorTest/_fakewebroot/vendor/silverstripe/mymodule/',
|
||||
__DIR__ . '/SimpleResourceURLGeneratorTest/_fakewebroot/'
|
||||
|
@ -642,6 +642,9 @@ class RequirementsTest extends SapphireTest
|
||||
$backend = Injector::inst()->create(Requirements_Backend::class);
|
||||
$this->setupRequirements($backend);
|
||||
|
||||
$generator = Injector::inst()->get(ResourceURLGenerator::class);
|
||||
$generator->setNonceStyle('mtime');
|
||||
|
||||
$backend->javascript('javascript/RequirementsTest_a.js?test=1&test=2&test=3');
|
||||
$backend->css('css/RequirementsTest_a.css?test=1&test=2&test=3');
|
||||
$html = $backend->includeInHTML(self::$html_template);
|
||||
|
Loading…
Reference in New Issue
Block a user