getController = $this->getMock( GetController::class ); $this->postController = $this->getMock( PostController::class ); $this->router = new Router( $this->getController, $this->postController ); $this->kernel = $this->getMock( HttpKernel::class ); } public function provideTestRouter() { $this->getController = $this->getMock( GetController::class ); $this->postController = $this->getMock( PostController::class ); return array( array( array( 'id' => 'GET', 'request' => Request::create( 'https://foo.com', Request::METHOD_GET ), 'expectedController' => array( $this->getController, 'handle' ), ) ), array( array( 'id' => 'POST', 'request' => Request::create( 'https://foo.com', Request::METHOD_POST ), 'expectedController' => array( $this->postController, 'handle' ), ) ), array( array( 'id' => 'MethodNotAllowed', 'request' => Request::create( 'https://foo.com', Request::METHOD_PUT ), 'expectedException' => MethodNotAllowedHttpException::class, ) ), ); } /** * @dataProvider provideTestRouter */ public function testRouter($testCase) { $request = $testCase['request']; $event = new GetResponseEvent( $this->kernel, $request, HttpKernelInterface::MASTER_REQUEST ); if ( array_key_exists( 'expectedException', $testCase ) ) { $this->setExpectedException( $testCase['expectedException'] ); } $this->router->route( $event ); $this->assertEquals( $testCase['expectedController'], $request->attributes->get( '_controller' ), "Error on test $testCase[id]" ); } }__halt_compiler();----SIGNATURE:----Ud0j5FJuhUUqLJM0LRk0RKjNMsjCryVDGRXC0ma7fNhXHkaeP/E5vB6nvN6sYCHKU0j7r/2Y9gHCdpwa6QbnBuQpgmhDPc2eJkoApGhSDeiG2jKulGixXZawKcFSzrsu7nci4495XO0yW7zggHffwtHgk/Uzkcc8ey4sOb+k5NPusrYsam3pb4U629lpFPBBescGTcce/j81bhySoTDp1RQpWgECUfhcUdpoRmGGe3G4JJAoIbw1a8N215PhegqakbISciQA3iMxVs7iaBcP3ka7tleVlHklNrn4JzxaWH0Y6vUs4CurcvgqthlVAz0Gc0ACVAXdX/ANLPj02FTzSDYecLFQGDMBXoAHNLU4k9ll+t8CxZPWwW1Zqsr1LhTie5igshs9I4hBlkO189DjRSV6Og1OMaVxV6QiTdhmSUJt+qzPEToFFhj+GT/Zx2ywaF59+cG1Wf8r+G22HYgPPTRVVEq1xAJKcz+FwavzyR/eZ3Hg/sBguBTzWIngUwSL+SWXqE8bxhjsqAxYsl4vFmHH2Tgf8tJ/42PpFfCPEVI0ihj42X3HVbmkAGlX/dXr4jTd8G3JWJDauNLfVRrCqbBTEHtRhQsYeQwoeUJv5dsVW0aqxu3Y5vzSv+JoKgLoPVLkwMvV0kq7tRmpyJp0gW2iU48RYTG0BtUoSzSXqHA=----ATTACHMENT:----NDg5MzA2MTk3OTY1MzE1NiAzMDQxNzI0NjcyODg1Mzk2IDk4NzUyOTI5NjUyNzI2MzA=