mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add a test for external resource support
`SimpleResourceURLGenerator` has been altered to allow absolute URLs to be loaded directly, as so is now also tested to ensure the added functionality is true to design.
This commit is contained in:
parent
9c3feb4ab4
commit
943821f984
@ -64,4 +64,12 @@ class SimpleResourceURLGeneratorTest extends SapphireTest
|
||||
$generator->urlForResource($module->getResource('client/style.css'))
|
||||
);
|
||||
}
|
||||
|
||||
public function testAbsoluteResource()
|
||||
{
|
||||
/** @var SimpleResourceURLGenerator $generator */
|
||||
$generator = Injector::inst()->get(ResourceURLGenerator::class);
|
||||
$fakeExternalAsset = 'https://cdn.example.com/some_library.css';
|
||||
$this->assertEquals($fakeExternalAsset, $generator->urlForResource($fakeExternalAsset));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user