public function testGetInvalidController() { $message = "test"; $exception = RouteException::getInvalidController($message); $this->assertEquals($exception->getMessage(), $message); $this->assertEquals($exception->getCode(), RouteException::INVALID_CONTROLLER_DESTINATION); }
protected function getCallable($destination) { $controller = $this->getController($destination); $method = substr($destination, strpos($destination, '@') + 1); if (empty($method)) { throw RouteException::getInvalidController("Invalid controller destination given, must be in format " . "'Countroller@method'."); } if (!method_exists($controller, $method)) { throw RouteException::getMissingConstructorMethod("The given method, {$method}, does not exist on the controller."); } return array($controller, $method); }