Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -128,4 +128,34 @@ class RouterListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertEquals('GET', $context->getMethod());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getLoggingParameterData
|
||||
*/
|
||||
public function testLoggingParameter($parameter, $log)
|
||||
{
|
||||
$requestMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
|
||||
$requestMatcher->expects($this->once())
|
||||
->method('matchRequest')
|
||||
->will($this->returnValue($parameter));
|
||||
|
||||
$logger = $this->getMock('Psr\Log\LoggerInterface');
|
||||
$logger->expects($this->once())
|
||||
->method('info')
|
||||
->with($this->equalTo($log));
|
||||
|
||||
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
|
||||
$request = Request::create('http://localhost/');
|
||||
|
||||
$listener = new RouterListener($requestMatcher, new RequestContext(), $logger, $this->requestStack);
|
||||
$listener->onKernelRequest(new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST));
|
||||
}
|
||||
|
||||
public function getLoggingParameterData()
|
||||
{
|
||||
return array(
|
||||
array(array('_route' => 'foo'), 'Matched route "foo".'),
|
||||
array(array(), 'Matched route "n/a".'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue