Browse Source

assertResponseNotContains

euromark 11 years ago
parent
commit
bdee069af7
1 changed files with 14 additions and 0 deletions
  1. 14 0
      TestSuite/IntegrationTestCase.php

+ 14 - 0
TestSuite/IntegrationTestCase.php

@@ -352,6 +352,20 @@ abstract class IntegrationTestCase extends MyControllerTestCase {
 	}
 	}
 
 
 /**
 /**
+ * Assert content does not exist in the response body.
+ *
+ * @param string $content The content to check for.
+ * @param string $message The failure message that will be appended to the generated message.
+ * @return void
+ */
+	public function assertResponseNotContains($content, $message = '') {
+		if (!$this->_response) {
+			$this->fail('No response set, cannot assert content. ' . $message);
+		}
+		$this->assertNotContains($content, $this->_response->body(), $message);
+	}
+
+/**
  * Assert that the search string was in the template name.
  * Assert that the search string was in the template name.
  *
  *
  * @param string $content The content to check for.
  * @param string $content The content to check for.