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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112772 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 00:52:57 +00:00
parent f99e6059b1
commit db8035e1a1

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');