You are here

protected function UrlTest::getRequestConstraint in Drupal 8

This constraint checks whether a Request object has the right path.

Parameters

string $path: The path.

Return value

\PHPUnit\Framework\Constraint\Callback The constraint checks whether a Request object has the right path.

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 166
Contains \Drupal\Tests\Core\UrlTest.

Class

UrlTest
@coversDefaultClass \Drupal\Core\Url @group UrlTest

Namespace

Drupal\Tests\Core

Code

protected function getRequestConstraint($path) {
  return $this
    ->callback(function (Request $request) use ($path) {
    return $request
      ->getPathInfo() == $path;
  });
}