/** * @expectedException \Owl\Http\Exception * @expectedExceptionCode 501 */ public function test501() { $app = new \Owl\Application(); $app->setExceptionHandler(function ($exception) { throw $exception; }); $request = \Owl\Http\Request::factory(['method' => 'FOO']); $response = new \Owl\Http\Response(); $app->execute($request, $response); }
<?php $serviceManager = new \Owl\Service\Manager(); $router = new \Owl\Router\Router(); $router->add('/', ['action' => '/']); $router->add('/user/{id:int}/', ['action' => 'view']); $router->add('/users', ['action' => 'users']); $serviceManager->set('router', $router); $application = new \Owl\Application($serviceManager); $application->handle(\Owl\Http\Request::createFromGlobals(), new \Owl\Http\Response());