Commit 47d05218 authored by alexpott's avatar alexpott

Issue #2864257 by GoZ, Jo Fitzgerald, klausi: Convert web tests AssertNoPattern to Browser Test

parent 2c2a7a88
......@@ -667,6 +667,22 @@ protected function assertPattern($pattern) {
$this->assertSession()->responseMatches($pattern);
}
/**
* Triggers a pass if the Perl regex pattern is not found in the raw content.
*
* @param string $pattern
* Perl regex to look for including the regex delimiters.
*
* @deprecated Scheduled for removal in Drupal 9.0.0.
* Use $this->assertSession()->responseNotMatches() instead.
*
* @see https://www.drupal.org/node/2864262
*/
protected function assertNoPattern($pattern) {
@trigger_error('assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead. See https://www.drupal.org/node/2864262.', E_USER_DEPRECATED);
$this->assertSession()->responseNotMatches($pattern);
}
/**
* Asserts whether an expected cache tag was present in the last response.
*
......
......@@ -153,6 +153,17 @@ public function testAssertOptionSelectedFail() {
$this->assertOptionSelected('myselect', 'two');
}
/**
* @covers ::assertNoPattern
*/
public function testAssertNoPattern() {
$this->webAssert
->responseNotMatches('/.*foo$/')
->shouldBeCalled();
$this->assertNoPattern('/.*foo$/');
}
/**
* Returns a mocked behat session object.
*
......
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