function IsFrontPathCacheContextTest::createPathMatcher
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php \Drupal\Tests\Core\Cache\Context\IsFrontPathCacheContextTest::createPathMatcher()
- 8.9.x core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php \Drupal\Tests\Core\Cache\Context\IsFrontPathCacheContextTest::createPathMatcher()
- 11.x core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php \Drupal\Tests\Core\Cache\Context\IsFrontPathCacheContextTest::createPathMatcher()
Creates a PathMatcherInterface prophecy.
Parameters
bool $is_front: Whether the page is the front page.
Return value
\Prophecy\Prophecy\ObjectProphecy
File
-
core/
tests/ Drupal/ Tests/ Core/ Cache/ Context/ IsFrontPathCacheContextTest.php, line 41
Class
- IsFrontPathCacheContextTest
- @coversDefaultClass \Drupal\Core\Cache\Context\IsFrontPathCacheContext @group Cache
Namespace
Drupal\Tests\Core\Cache\ContextCode
protected function createPathMatcher($is_front) {
$path_matcher = $this->prophesize(PathMatcherInterface::class);
$path_matcher->isFrontPage()
->willReturn($is_front);
return $path_matcher;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.