1 system.test PageNotFoundTestCase::testPageNotFound()

File

core/modules/system/tests/system.test, line 964
Tests for system.module.

Class

PageNotFoundTestCase

Code

function testPageNotFound() {
  $this->backdropGet($this->randomName(10));
  $this->assertText(t('Page not found'), 'Found the default 404 page');

  $edit = array(
    'title' => $this->randomName(10),
    'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
  );
  $node = $this->backdropCreateNode($edit);

  // Use a custom 404 page.
  $this->backdropPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration'));

  $this->backdropGet($this->randomName(10));
  $this->assertText($node->title, 'Found the custom 404 page');
}