function AssertLegacyTrait::assertUrl

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertUrl()

Passes if the internal browser's URL matches the given path.

Parameters

\Drupal\Core\Url|string $path: The expected system path or URL.

Deprecated

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

See also

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

1 call to AssertLegacyTrait::assertUrl()
AssertLegacyTraitTest::testAssertUrl in core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php
@covers ::assertUrl

File

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

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertUrl($path) {
    @trigger_error('AssertLegacyTrait::assertUrl() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->addressEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    if (func_num_args() > 1) {
        @trigger_error('Calling AssertLegacyTrait::assertUrl() with more than one argument is deprecated in drupal:8.2.0 and the method is removed from drupal:10.0.0. Use $this->assertSession()->addressEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    }
    $this->assertSession()
        ->addressEquals($path);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.