public function MockMatcher::matchRequest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Routing/MockMatcher.php \Drupal\system\Tests\Routing\MockMatcher::matchRequest()
Tries to match a request with a set of routes.
If the matcher can not find information, it must throw one of the exceptions documented below.
Parameters
Request $request The request to match:
Return value
array An array of parameters
Throws
ResourceNotFoundException If no matching resource could be found
MethodNotAllowedException If a matching resource was found but the request method is not allowed
Overrides RequestMatcherInterface::matchRequest
File
- core/
modules/ system/ src/ Tests/ Routing/ MockMatcher.php, line 36 - Contains \Drupal\system\Tests\Routing\MockMatcher.
Class
- MockMatcher
- A mock matcher that can be configured with any matching logic for testing.
Namespace
Drupal\system\Tests\RoutingCode
public function matchRequest(Request $request) {
$matcher = $this->matcher;
return $matcher($request);
}