You are here

protected function AssertLegacyTrait::assertPattern in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertPattern()

Triggers a pass if the Perl regex pattern is found in the raw content.

Parameters

string $pattern: Perl regex to look for including the regex delimiters.

Deprecated

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseMatches() instead.

See also

https://www.drupal.org/node/3129738

1 call to AssertLegacyTrait::assertPattern()
BrowserTestBaseTest::testAssertPattern in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy assertPattern().

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 827

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertPattern($pattern) {
  @trigger_error('AssertLegacyTrait::assertPattern() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseMatches() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
  $this
    ->assertSession()
    ->responseMatches($pattern);
}