silverstripe-framework/tests/ErrorPageTest.php
Sean Harvey 2b30a71ae3 MINOR Tweaked ErrorPageTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75114 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:17 +13:00

29 lines
975 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class ErrorPageTest extends FunctionalTest {
static $fixture_file = 'sapphire/tests/ErrorPageTest.yml';
function test404ErrorPage() {
$page = $this->objFromFixture('ErrorPage', '404');
/* The page is an instance of ErrorPage */
$this->assertTrue($page instanceof ErrorPage, 'The page is an instance of ErrorPage');
$response = $this->get($page->URLSegment);
/* We have body text from the error page */
$this->assertNotNull($response->getBody(), 'We have body text from the error page');
/* Status code of the HTTPResponse for error page is "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" */
$this->assertEquals($response->getStatusDescription(), 'Not Found', 'Status message of the HTTResponse for error page is "Not found"');
}
}
?>