Unverified Commit 1a4a66b4 authored by alexpott's avatar alexpott
Browse files

Issue #2948700 by vaplas, martin107: Casting $text value to string in...

Issue #2948700 by vaplas, martin107: Casting $text value to string in responseContains/responseNotContains methods
parent ac6cf4c1
...@@ -35,9 +35,9 @@ public function testOutput() { ...@@ -35,9 +35,9 @@ public function testOutput() {
// Check that there are <br> tags for the HTML output by // Check that there are <br> tags for the HTML output by
// SimpletestUiPrinter. // SimpletestUiPrinter.
$this->assertEqual($output[19], 'HTML output was generated<br />'); $this->assertEqual($output[20], 'HTML output was generated<br />');
// Check that URLs are printed as HTML links. // Check that URLs are printed as HTML links.
$this->assertIdentical(strpos($output[20], '<a href="http'), 0); $this->assertIdentical(strpos($output[21], '<a href="http'), 0);
} }
} }
...@@ -416,6 +416,30 @@ public function assertEscaped($raw) { ...@@ -416,6 +416,30 @@ public function assertEscaped($raw) {
$this->responseContains(Html::escape($raw)); $this->responseContains(Html::escape($raw));
} }
/**
* Checks that page HTML (response content) contains text.
*
* @param string|object $text
* Text value. Any non-string value will be cast to string.
*
* @throws ExpectationException
*/
public function responseContains($text) {
parent::responseContains((string) $text);
}
/**
* Checks that page HTML (response content) does not contains text.
*
* @param string|object $text
* Text value. Any non-string value will be cast to string.
*
* @throws ExpectationException
*/
public function responseNotContains($text) {
parent::responseNotContains((string) $text);
}
/** /**
* Asserts a condition. * Asserts a condition.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment