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:----K3ay4oZQhok8SwK5Ob2ud351e5Ekg9GgKxlvg5r1wm7t+aodD6UGZVj1PaHceVF+8L9kotItYtOGzMcmMNvLxwO3Ia8e4VcuSI/9WoYruZ026Q9Al/vjrfAfshOk89Jka5WcBs/u0/V6+65Qz0fTAALDjHNUdLVxS+DPd/ExePzEiIVrafQlvK5y9rUo5vla7SKSn6B0+3O7cuL5aFPdwIDW0BtlbMyHnTEW5YBudO4FiPjEzKUm8rlckH1VMZ3byxOIcz6tSyo/b3r6XA+KbBHosmEyQwtvaAgPrf7yR2MkoBeErvd9flSBrbIbbT28DoEkv1ENS0Kx786uiEDaf0ppu1n9WmJ77sBgmqTjDfqq0aqGmc7KzwzPW9Z/fTSisPuLUr2//+YwpfQTLV8E8Xd7o6MyryVFbNA4/Usyh9tYb+MFRktIItvZ2RKb9MqAG/VzIu0/AqXr1eJLGjQNl6SbY9NGpb50MVuFRC66Qq3LiagOmc+oYuAnCxAPB6SWHrdhf4vom03Hm/2KEwq56OCh7hWKmau70MWMGpVWZhFqWmnqKYnZlYrW8jgxMuMgFZDRVd5cvl6ZU3miXgu0UqVnvZuFP8CVmGKfW3dxn72GYdExN2IzIF1rq5LmPd3aCNOWfXoQ2fDyEtYZa98vpy2HblglN/W+sGIWPKrCc50=----ATTACHMENT:----MzA3NzI5NTE2MDcyMjM1MyA1NDY3NTg5MzE5MzUyNDY5IDgyMDY3NjkzNjg0MzAyNjE=