Exemplo n.º 1
0
 /**
  * Returns the Handler which is responsible for handling the current request
  *
  * @return HandlerInterface
  */
 public function getHandler()
 {
     /** @var \Cundd\Rest\HandlerInterface $handler */
     list($vendor, $extension, ) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());
     // Check if an extension provides a Handler
     $handlerClass = 'Tx_' . $extension . '_Rest_Handler';
     if (!class_exists($handlerClass)) {
         $handlerClass = ($vendor ? $vendor . '\\' : '') . $extension . '\\Rest\\Handler';
     }
     // Get the specific builtin handler
     if (!class_exists($handlerClass)) {
         $handlerClass = 'Cundd\\Rest\\Handler\\' . $extension . 'Handler';
         // Get the default handler
         if (!class_exists($handlerClass)) {
             $handlerClass = 'Cundd\\Rest\\HandlerInterface';
         }
     }
     $handler = $this->get($handlerClass);
     //$handler->setRequest($this->dispatcher->getRequest());
     return $handler;
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function getUnderscoredPathWithFormatTest2()
 {
     $_GET['u'] = 'my_ext-my_model.json';
     $path = $this->fixture->getPath();
     $this->assertEquals('my_ext-my_model', $path);
 }