MockMatcher.php in Drupal 8
File
core/modules/system/tests/src/Functional/Routing/MockMatcher.php
View source
<?php
namespace Drupal\Tests\system\Functional\Routing;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
class MockMatcher implements RequestMatcherInterface {
protected $matcher;
public function __construct(\Closure $matcher) {
$this->matcher = $matcher;
}
public function matchRequest(Request $request) {
$matcher = $this->matcher;
return $matcher($request);
}
}
Classes
Name |
Description |
MockMatcher |
A mock matcher that can be configured with any matching logic for testing. |