You are here

public function WebAssert::addressEquals in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/WebAssert.php \Drupal\Tests\WebAssert::addressEquals()

File

core/tests/Drupal/Tests/WebAssert.php, line 724

Class

WebAssert
Defines a class with methods for asserting presence of elements during tests.

Namespace

Drupal\Tests

Code

public function addressEquals($page) {
  assert(func_num_args() === 1);
  $expected = $this
    ->cleanUrl($page, TRUE);
  $actual = $this
    ->cleanUrl($this->session
    ->getCurrentUrl(), strpos($expected, '?') !== FALSE);
  $this
    ->assert($actual === $expected, sprintf('Current page is "%s", but "%s" expected.', $actual, $expected));
}