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:----eh1b4ya067qzI9fs1CMPI5ScWMPNgIMNSm7fvURGyHYs4I/dpEAgTcbyZkZExQsMRGj176/yPIHcI+7E9gIH408V1fbjqXB4NEt1t6jwwg26PiBSTkqIIyh+e0nmCm0YOAn+TeEnSXzp2OpMM9B4VYB174s34+SdYeFlhK5fMqk5Bd4yNyCrDAoc8reCdASV7TB06NrAWCEb/RAzeAyXmOL/YZTccMuJ4XRUvwbcD+ranWOpwoNkf69sI6t8OknEDx4k6mtpwgdoP8/84dhHW8osik3wUgGPdO2LuP8Rk5cAm26PsvTg3wfZaLQqy9O2fm0CbMzD78eDgmIdO/lbrMDjWbrtflpAadtnPE+Em4Dgk8JSD3D+PqHsyeuZj6L2xKlEWDuTW6+5FZaGsheevXl0L6m5yp+ZAoIzF2WDcB+A37rEEswCPvP2iqSO8IUJS71b5OpZVbiHhBTx/zyhj2fAW005/pc+8S2PZ4+02uZ0W5/De1htOe4fMNSK/RyiKOHziHhj7rZvLIG/zu/TToLnF5Fl0SapoY9HMZeO2e3YcIOUdZVrAbDTcwbJ+FoInvRJtZQEUKu2reBOj2qYxKseCzuGbBSFeUx81dMv/fzWSjKead/LAPzELbrabtyLWrRr2oW9DYE4Xe2Hh2U+25G9Xqj9yxqakMp7IHgZxtI=----ATTACHMENT:----NTE4MjI4NDY3MTcyOTA4NiA4OTYyNTYxMjkwNjY2OTk5IDIwODIxMzgzNjA1NzA1OQ==