From 92976e8eff58a72f305fe77d505fb5ecdb5b7b60 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 30 Mar 2010 20:43:34 +0000 Subject: [PATCH] MINOR get the files & error page tests on subsites passing --- code/ErrorPageSubsite.php | 2 +- tests/FileSubsitesTest.php | 1 + tests/SiteTreeSubsitesTest.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/ErrorPageSubsite.php b/code/ErrorPageSubsite.php index 0a32cfe..02a854e 100644 --- a/code/ErrorPageSubsite.php +++ b/code/ErrorPageSubsite.php @@ -22,7 +22,7 @@ class ErrorPageSubsite extends DataObjectDecorator { } if($subsite) { - $subdomain = $subsite->Subdomain; + $subdomain = $subsite->Domains()->First()->Domain; $subdomainPart = "-{$subdomain}"; } diff --git a/tests/FileSubsitesTest.php b/tests/FileSubsitesTest.php index be2723e..5f2429b 100644 --- a/tests/FileSubsitesTest.php +++ b/tests/FileSubsitesTest.php @@ -6,6 +6,7 @@ class FileSubsitesTest extends SapphireTest { function testTrivialFeatures() { $this->assertTrue(is_array(singleton('FileSubsites')->extraStatics())); $file = new File(); + $file->Name = 'FileTitle'; $file->Title = 'FileTitle'; $this->assertEquals(' * FileTitle', $file->alternateTreeTitle()); $file->SubsiteID = $this->objFromFixture('Subsite', 'domaintest1')->ID; diff --git a/tests/SiteTreeSubsitesTest.php b/tests/SiteTreeSubsitesTest.php index 5c81b6d..a644e6f 100644 --- a/tests/SiteTreeSubsitesTest.php +++ b/tests/SiteTreeSubsitesTest.php @@ -51,7 +51,7 @@ class SiteTreeSubsitesTest extends SapphireTest { $path = ErrorPage::get_filepath_for_errorcode(500); $static_path = Object::get_static('ErrorPage', 'static_filepath'); - $expected_path = $static_path . '/error-500-'.$subsite1->Subdomain.'.html'; + $expected_path = $static_path . '/error-500-'.$subsite1->Domains()->First()->Domain.'.html'; $this->assertEquals($expected_path, $path); }