From 01b34bdd5931fdb936c71c55a03bc480182b467b Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 21 May 2008 23:51:17 +0000 Subject: [PATCH] Fixed RSS feed test for environments without base url set-up git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@54899 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/api/RSSFeedTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/api/RSSFeedTest.php b/tests/api/RSSFeedTest.php index 868b502e7..02ac4f707 100644 --- a/tests/api/RSSFeedTest.php +++ b/tests/api/RSSFeedTest.php @@ -7,13 +7,16 @@ class RSSFeedTest extends SapphireTest { $list->push(new RSSFeedTest_ItemA()); $list->push(new RSSFeedTest_ItemB()); $list->push(new RSSFeedTest_ItemC()); + + $origServer = $_SERVER; + $_SERVER['HTTP_HOST'] = 'www.example.org'; + $_SERVER['SCRIPT_NAME'] = '/sapphire/main.php'; $rssFeed = new RSSFeed($list, "http://www.example.com", "Test RSS Feed", "Test RSS Feed Description"); $content = $rssFeed->feedContent(); // Debug::message($content); - - $this->assertContains('' . Director::absoluteBaseURL() . 'item-a/', $content); + $this->assertContains('http://www.example.org/item-a/', $content); $this->assertContains('http://www.example.com/item-b.html', $content); $this->assertContains('http://www.example.com/item-c.html', $content); @@ -37,7 +40,8 @@ class RSSFeedTest extends SapphireTest { $this->assertContains('ItemA AltContent', $content); $this->assertContains('ItemB AltContent', $content); $this->assertContains('ItemC AltContent', $content); - + + $_SERVER = $origServer; } }