Exemple #1
0
 public function testSmallUrl()
 {
     $request = Request::create('x2.txt', 'DELETE');
     $parser = new Parser($request);
     $this->assertEquals('App', $parser->getNamespace());
     $this->assertEquals('X2', $parser->getClassName());
     $this->assertEquals('DELETE', $parser->getRequestMethod());
     $this->assertEquals('txt', $parser->getAction());
     $this->assertEquals('App\\X2', $parser->getClassFullName());
 }
Exemple #2
0
 public function invokeAction()
 {
     if ($this->isReady) {
         $requestMethod = $this->parser->getRequestMethod();
         if ($this->rAnotations->has($requestMethod)) {
             return $this->invokeFunctionWithFixtures();
         } else {
             throw new Exception("Method {$requestMethod} not allowed", 405);
         }
     } else {
         throw new Exception("Not Found", 404);
     }
 }