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:
Dylan Wagstaff 2018-01-23 17:43:01 +13:00 committed by GitHub
parent 9c3feb4ab4
commit 943821f984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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));
}
}