MINOR More robust RedirectorPageTest implementation that doesn't rely on _t() calls which are mysteriously failing on all subsequent calls in PHPUnit

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85311 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-08-27 03:10:13 +00:00
parent f073fd9f5b
commit 685cd996a6
2 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ class RedirectorPage_Controller extends Page_Controller {
*/
function index() {
return array(
"Content" => "<p>" .
"Content" => "<p class=\"message-setupWithoutRedirect\">" .
_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
"</p>"
);

View File

@ -18,13 +18,13 @@ class RedirectorPageTest extends FunctionalTest {
/* An error message will be shown if you visit it */
$content = $this->get(Director::makeRelative($page1->Link()))->getBody();
$this->assertContains(_t('RedirectorPage.HASBEENSETUP'), $content);
$this->assertContains('message-setupWithoutRedirect', $content);
/* This also applies for internal links */
$page2 = $this->objFromFixture('RedirectorPage','badinternal');
$this->assertEquals(Director::baseURL() . 'bad-internal/', $page2->Link());
$content = $this->get(Director::makeRelative($page2->Link()))->getBody();
$this->assertContains(_t('RedirectorPage.HASBEENSETUP'), $content);
$this->assertContains('message-setupWithoutRedirect', $content);
}
function testReflexiveAndTransitiveInternalRedirectors() {
@ -32,7 +32,7 @@ class RedirectorPageTest extends FunctionalTest {
$page = $this->objFromFixture('RedirectorPage','reflexive');
$this->assertEquals(Director::baseURL() . 'reflexive/', $page->Link());
$content = $this->get(Director::makeRelative($page->Link()))->getBody();
$this->assertContains(_t('RedirectorPage.HASBEENSETUP'), $content);
$this->assertContains('message-setupWithoutRedirect', $content);
/* Transitive redirectors are those that point to another redirector page. They should send people to the URLSegment
* of the destination page - the middle-stop, so to speak. That should redirect to the final destination */