Пример #1
0
 /**
  * @covers \Core\Router\Router::handle
  * @covers \Core\Router\Router::getNextCallable
  * @covers \Core\Router\Router::getFunctionArgs
  * @covers \Core\Router\Router::makeController
  */
 public function testControllerSupportsTypeHinting()
 {
     $application = new Application(MockPaths::$basePath);
     $router = $this->application->make(\Core\Router\Router::class, $application, 'Router');
     $router->get('/test/{id:num}/page/{pageId:num}', '\\Core\\Tests\\Stubs\\Controllers\\StubController@testTypeHint');
     $response = $router->handle(Request::create('/test/12/page/10'));
     $this->assertInternalType('array', $response);
     $this->assertInternalType('array', $response[0]);
     $this->assertInstanceOf('\\Core\\FileSystem\\FileSystem', $response[1]);
     $this->assertInstanceOf('\\Core\\Request\\Request', $response[2]);
 }