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:----wp8f73ZvrJ4OLMB6NwiWkA7Ohu2jEM0g/xBVmx8sHcsvWe39YoM0pEJpW5fhmtEZqJF1k4isUIysiG3HVJ56KaRcGvpxfs75N+x+D9Z/vnAu5zn0FQxsNX/GdVFKndX98aarjSD0Nvkfg1sxVb/+TXCtHQHUZhMzj9CO4rdOT/a6KFjOmRoRJwrB17WlBkAjDW0Jpd5wUW/LUuGBMO3bqKiNkUh565uO5qLHiQPhsabuFswz+dSyZ5yolDFwFPpmS8uHbzo1yYEowH2jpXEI45KDIaiIpbbDQeP0Y3XvDcp9v8tSRtaiG68vNcR/YnTpZ5LOCcjSaLcWG3vvVp7zso4FcoAoYiBH/hHKu4heqmZNJuVG/18QtR7fLfGcfqc1obsRWjmuvHsMmd7Ou4G8Z5z+4cphG6dbsXabtq1STu71YDlBYAjZPMfSRVYekVFz1d1SwLTAqfFYMom/wJCwshz1aA2CewwrOJQ2H6EJF9gnvzHf7RhOzgLpg0sW1dJZPOhWWUVxn6K16hbQEa1PVov6XOIKZBMR0GWlZ91M00cg+KEFehTztX4TBd0waOFn96EzbWaS5M1smDNMXU0JO4Xr5nRJud20rM1LmlKVTnTieqw5toanTakWOt3qOKUVokOZhxBED+KafJU/V068kiJYsH4t6Rn3amzTPQVq0SA=----ATTACHMENT:----OTQwNDA4MjUyNjE3MTQ5NSAyMjk4NTYzNjU0MjgzODQ5IDExNTA0NTkyNDM0Mzk5NjY=