/** * 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; }
/** * @test */ public function getUnderscoredPathWithFormatTest2() { $_GET['u'] = 'my_ext-my_model.json'; $path = $this->fixture->getPath(); $this->assertEquals('my_ext-my_model', $path); }