mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
bd93c623fc
commit
01b34bdd59
@ -8,12 +8,15 @@ class RSSFeedTest extends SapphireTest {
|
||||
$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('<link>' . Director::absoluteBaseURL() . 'item-a/</link>', $content);
|
||||
$this->assertContains('<link>http://www.example.org/item-a/</link>', $content);
|
||||
$this->assertContains('<link>http://www.example.com/item-b.html</link>', $content);
|
||||
$this->assertContains('<link>http://www.example.com/item-c.html</link>', $content);
|
||||
|
||||
@ -38,6 +41,7 @@ class RSSFeedTest extends SapphireTest {
|
||||
$this->assertContains('<description>ItemB AltContent</description>', $content);
|
||||
$this->assertContains('<description>ItemC AltContent</description>', $content);
|
||||
|
||||
$_SERVER = $origServer;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user