From db8035e1a1c7648c1eb02039568ac0ab8229a7e5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 00:52:57 +0000 Subject: [PATCH] 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 --- tests/filesystem/FileTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/filesystem/FileTest.php b/tests/filesystem/FileTest.php index 4d2adebde..5fe7de8fa 100644 --- a/tests/filesystem/FileTest.php +++ b/tests/filesystem/FileTest.php @@ -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');