浏览代码

assertResponseNotContains

euromark 11 年之前
父节点
当前提交
bdee069af7
共有 1 个文件被更改,包括 14 次插入0 次删除
  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.
  *
  * @param string $content The content to check for.