? simpletest.assert-title.patch
? simpletest_assertTitle_2.patch
Index: drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.2.2.3.2.23
diff -u -r1.2.2.3.2.23 drupal_web_test_case.php
--- drupal_web_test_case.php	10 Dec 2008 16:29:26 -0000	1.2.2.3.2.23
+++ drupal_web_test_case.php	15 Jan 2009 21:46:03 -0000
@@ -1535,8 +1535,24 @@
    * @return
    *   TRUE on pass, FALSE on fail.
    */
-  function assertTitle($title, $message, $group = 'Other') {
-    return $this->_assert($this->xpath('//title[text()="' . $title . '"]') !== FALSE, $message, $group);
+  protected function assertTitle($title, $message, $group = 'Other') {
+    return $this->assertTrue($this->xpath('//title[text()="' . $title . '"]'), $message, $group);
+  }
+
+  /**
+  * Pass if the page title is not the given string.
+  *
+  * @param $title
+  *   The string the title should not be.
+  * @param $message
+  *   Message to display.
+  * @param $group
+  *   The group this message belongs to.
+  * @return
+  *   TRUE on pass, FALSE on fail.
+  */
+  protected function assertNoTitle($title, $message, $group = 'Other') {
+    return $this->assertFalse($this->xpath('//title[text()="' . $title . '"]'), $message, $group);
   }
 
   /**
Index: simpletest.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/Attic/simpletest.test,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 simpletest.test
--- simpletest.test	3 Dec 2008 06:42:45 -0000	1.1.2.6
+++ simpletest.test	15 Jan 2009 21:46:06 -0000
@@ -52,6 +52,7 @@
       $this->drupalGet('node');
       $this->assertTrue($this->drupalGetHeader('Date'), t('An HTTP header was received.'));
       $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.'));
+      $this->assertNoTitle('Foo', t('Site title does not match.'));
       // Make sure that we are locked out of the installer when prefixing
       // using the user-agent header. This is an important security check.
       global $base_url;
