From a43459515bf33c18d7193b1837e89bcf4ac48cc2 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 9 Mar 2010 01:10:39 +0000 Subject: [PATCH] BUGFIX Removed backticks from SubsiteTest --- tests/SubsiteTest.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/SubsiteTest.php b/tests/SubsiteTest.php index 7185ef5..dfc2219 100644 --- a/tests/SubsiteTest.php +++ b/tests/SubsiteTest.php @@ -45,11 +45,7 @@ class SubsiteTest extends SapphireTest { // Test that changeSubsite is working Subsite::changeSubsite($template->ID); - if(defined('DB::USE_ANSI_SQL')) - $q="\""; - else $q='`'; - - $tmplHome = DataObject::get_one('SiteTree', "{$q}URLSegment{$q} = 'home'"); + $tmplHome = DataObject::get_one('SiteTree', "\"URLSegment\" = 'home'"); // Publish all the pages in the template, testing that DataObject::get only returns pages from the chosen subsite $pages = DataObject::get("SiteTree"); @@ -71,7 +67,7 @@ class SubsiteTest extends SapphireTest { // Another test that changeSubsite is working Subsite::changeSubsite($subsite->ID); - $siteHome = DataObject::get_one('SiteTree', "{$q}URLSegment{$q} = 'home'"); + $siteHome = DataObject::get_one('SiteTree', "\"URLSegment\" = 'home'"); $this->assertNotNull($siteHome); $this->assertEquals($subsite->ID, $siteHome->SubsiteID, 'createInstance() copies existing pages retaining the same URLSegment' @@ -80,7 +76,7 @@ class SubsiteTest extends SapphireTest { // Check linking of child pages $tmplStaff = $this->objFromFixture('SiteTree','staff'); - $siteStaff = DataObject::get_one('SiteTree', "{$q}URLSegment{$q} = '" . Convert::raw2sql($tmplStaff->URLSegment) . "'"); + $siteStaff = DataObject::get_one('SiteTree', "\"URLSegment\" = '" . Convert::raw2sql($tmplStaff->URLSegment) . "'"); $this->assertEquals($siteStaff->MasterPageID, $tmplStaff->ID); Subsite::changeSubsite(0);