Exemplo n.º 1
0
 /**
  * @dataProvider additionMethods
  */
 public function testExceptionHas405($method)
 {
     $_SERVER['REQUEST_METHOD'] = $method;
     $app = new \LionHead\Kernel();
     $this->assertInstanceOf('LionHead\\Kernel', $app);
     #
     $this->assertInstanceOf('LionHead\\Container', $app->get());
     #
     $app->addRoute('GET', '/', function ($arg, $di) {
         return 1;
     });
     /* assert */
     $this->setExpectedException('\\LionHead\\Exception\\NotFoundException', 'Method Not Allowed', '405');
     $app->handle(Request::create('/', $method));
 }
Exemplo n.º 2
0
 /**
  * [run description]
  * @method run
  * @param  string request path
  */
 public function run($request = null)
 {
     $this->resolve();
     $request = $request ?: Request::createFromGlobals();
     $response = $this->handle($request);
     $this->send($response, false);
     $this->terminate($request, $response);
 }