diff --git a/core/modules/simpletest/src/AssertContentTrait.php b/core/modules/simpletest/src/AssertContentTrait.php index eb1a80c..b5d3b4f 100644 --- a/core/modules/simpletest/src/AssertContentTrait.php +++ b/core/modules/simpletest/src/AssertContentTrait.php @@ -527,6 +527,18 @@ protected function assertNoEscaped($raw, $message = '', $group = 'Other') { return $this->assert(strpos($this->getRawContent(), Html::escape($raw)) === FALSE, $message, $group); } + + /** + * Temporary assert. + * @param $raw + * @param $out + * @return mixed + */ + protected function assertNotEscaped($raw, $out) { + $message = 'ESCAPÉ "' . Html::escape($raw) . '" NOT FOUND'; + return $this->assert(strpos($out, Html::escape($raw)) === FALSE, $message, $group = 'Other'); + } + /** * Passes if the page (with HTML stripped) contains the text. * diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index c890beb..4828faa 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1548,6 +1548,8 @@ protected function drupalGet($path, array $options = array(), array $headers = a $verbose .= '
' . $out; $this->verbose($verbose); + $this->assertNoEscaped('<', $out); + $this->assertNoEscaped('&', $out); return $out; } @@ -1781,6 +1783,8 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array( $verbose .= '
' . $out; $this->verbose($verbose); + $this->assertNotEscaped('<', $out); + $this->assertNotEscaped('&', $out); return $out; } } @@ -2084,7 +2088,7 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr * @see WebTestBase::curlExec() */ protected function drupalPost($path, $accept, array $post, $options = array()) { - return $this->curlExec(array( + $out = $this->curlExec(array( CURLOPT_URL => $this->buildUrl($path, $options), CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $this->serializePostValues($post), @@ -2093,6 +2097,10 @@ protected function drupalPost($path, $accept, array $post, $options = array()) { 'Content-Type: application/x-www-form-urlencoded', ), )); + + $this->assertNotEscaped('<', $out); + $this->assertNotEscaped('&', $out); + return $out; } /**