MINOR Added tests for File::getURL() and File::getAbsoluteURL()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@109066 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-08-08 23:48:54 +00:00 committed by Sam Minnee
parent d85e75fbe6
commit a699ff1a75

View File

@ -149,6 +149,16 @@ class FileTest extends SapphireTest {
$this->assertEquals(ASSETS_PATH . '/FileTest.txt', $rootfile->getFullPath(), 'File in assets/ folder');
}
function testGetURL() {
$rootfile = $this->objFromFixture('File', 'asdf');
$this->assertEquals(Director::baseURL() . $rootfile->getFilename(), $rootfile->getURL());
}
function testGetAbsoluteURL() {
$rootfile = $this->objFromFixture('File', 'asdf');
$this->assertEquals(Director::absoluteBaseURL() . $rootfile->getFilename(), $rootfile->getAbsoluteURL());
}
function testNameAndTitleGeneration() {
/* If objects are loaded into the system with just a Filename, then Name is generated but Title isn't */
$file = $this->objFromFixture('File', 'asdf');