You are here

public function PathMatcherTest::testMatchPathMatched in Acquia Lift Connector 8

Tests the match() method - path is matched.

@covers ::match

File

tests/src/Unit/Service/Helper/PathMatcherTest.php, line 64
Contains \Drupal\Tests\acquia_lift\Service\Helper\PathMatcherTest.

Class

PathMatcherTest
PathMatcher Test.

Namespace

Drupal\Tests\acquia_lift\Service\Helper

Code

public function testMatchPathMatched() {
  $this->basePathMatcher
    ->expects($this
    ->once())
    ->method('matchPath')
    ->with('a_path', 'a_pattern')
    ->willReturn(TRUE);
  $this->aliasManager
    ->expects($this
    ->never())
    ->method('getAliasByPath');
  $pathMatcher = new PathMatcher($this->aliasManager, $this->basePathMatcher);
  $is_matched = $pathMatcher
    ->match('A_PATH', 'A_PATTERN');
  $this
    ->assertTrue($is_matched);
}