mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Fixed ErrorPage test failing because the fixture couldn't be found
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75109 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
35a3cd9257
commit
dd97216484
@ -1,31 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
class ErrorPageTest extends SapphireTest {
|
* @package sapphire
|
||||||
|
* @subpackage tests
|
||||||
|
*/
|
||||||
|
class ErrorPageTest extends FunctionalTest {
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/tests/ErrorPageTest.yml';
|
static $fixture_file = 'sapphire/tests/ErrorPageTest.yml';
|
||||||
|
|
||||||
function test404ErrorPage() {
|
function test404ErrorPage() {
|
||||||
$errorPage = DataObject::get_one('ErrorPage', "ErrorCode = '404'");
|
$errorPage = $this->objFromFixture('ErrorPage', '404');
|
||||||
|
|
||||||
/* We have an ErrorPage object to use */
|
/* We have an ErrorPage object to use */
|
||||||
$this->assertTrue($errorPage instanceof ErrorPage);
|
$this->assertTrue($errorPage instanceof ErrorPage);
|
||||||
|
|
||||||
/* Test the URL of the error page out to get a response */
|
/* Test the URL of the error page out to get a response */
|
||||||
$response = Director::test(Director::makeRelative($errorPage->Link()));
|
$response = $this->get($errorPage->URLSegment);
|
||||||
|
|
||||||
/* We have an HTTPResponse object for the error page */
|
/* We have an HTTPResponse object for the error page */
|
||||||
$this->assertTrue($response instanceof HTTPResponse);
|
$this->assertTrue($response instanceof HTTPResponse);
|
||||||
|
|
||||||
/* We have body text from the error page */
|
/* We have body text from the error page */
|
||||||
$this->assertTrue($response->getBody() != null);
|
$this->assertNotNull($response->getBody(), 'We have body text from the error page');
|
||||||
|
|
||||||
/* Status code of the HTTPResponse for error page is "404" */
|
/* Status code of the HTTPResponse for error page is "404" */
|
||||||
$this->assertTrue($response->getStatusCode() == '404');
|
$this->assertEquals($response->getStatusCode(), '404', 'Status cod eof the HTTPResponse for error page is "404"');
|
||||||
|
|
||||||
/* Status message of the HTTPResponse for error page is "Not Found" */
|
/* Status message of the HTTPResponse for error page is "Not Found" */
|
||||||
$this->assertTrue($response->getStatusDescription() == 'Not Found');
|
$this->assertEquals($response->getStatusDescription(), 'Not Found', 'Status message of the HTTResponse for error page is "Not found"');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user