summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-11 20:11:40 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-11 20:11:40 +0000
commit60524be44b6b6a7c276514643ae8430840de2ab1 (patch)
tree5a73b87db42c5a155c8a235fcfc477ec0404c510 /modules/simpletest/drupal_web_test_case.php
parent8802e0d3aff7b993a0325e46eb33f3855a72bbe3 (diff)
downloadbrdo-60524be44b6b6a7c276514643ae8430840de2ab1.tar.gz
brdo-60524be44b6b6a7c276514643ae8430840de2ab1.tar.bz2
- Patch #345632 by boombatower: corrected assertTitle logic and added assertNoTitle for completeness.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 679d51a4d..ce94a858c 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1705,7 +1705,23 @@ class DrupalWebTestCase {
* TRUE on pass, FALSE on fail.
*/
protected function assertTitle($title, $message, $group = 'Other') {
- return $this->assert($this->xpath('//title[text()="' . $title . '"]') !== FALSE, $message, $group);
+ 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);
}
/**