protected function DrupalWebTestCase::assertTitle

7.x drupal_web_test_case.php protected DrupalWebTestCase::assertTitle($title, $message = '', $group = 'Other')

Pass if the page title is the given string.

Parameters

$title: The string the title should be.

$message: Message to display.

$group: The group this message belongs to.

Return value

TRUE on pass, FALSE on fail.

26 calls to DrupalWebTestCase::assertTitle()
BlogTestCase::testBlogPageNoEntries in drupal/modules/blog/blog.test
View the blog of a user with no blog entries as another user.
BlogTestCase::testUnprivilegedUser in drupal/modules/blog/blog.test
Confirm that the "You are not allowed to post a new blog entry." message shows up if a user submitted blog entries, has been denied that permission, and goes to the blog page.
BlogTestCase::verifyBlogLinks in drupal/modules/blog/blog.test
Verify the blog links are displayed to the logged in user.
BlogTestCase::verifyBlogs in drupal/modules/blog/blog.test
Verify the logged in user has the desired access to the various blog nodes.
BootstrapPageCacheTestCase::testPageCompression in drupal/modules/simpletest/tests/bootstrap.test
Test page compression.

... See full list

File

drupal/modules/simpletest/drupal_web_test_case.php, line 3117

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

protected function assertTitle($title, $message = '', $group = 'Other') {
  $actual = (string) current($this->xpath('//title'));
  if (!$message) {
    $message = t('Page title @actual is equal to @expected.', array(
      '@actual' => var_export($actual, TRUE),
      '@expected' => var_export($title, TRUE),
    ));
  }
  return $this->assertEqual($actual, $title, $message, $group);
}