コード例 #1
0
 public function testGetMissingConstructorMethod()
 {
     $message = "test";
     $exception = RouteException::getMissingConstructorMethod($message);
     $this->assertEquals($exception->getMessage(), $message);
     $this->assertEquals($exception->getCode(), RouteException::MISSING_CONSTRUCTOR_METHOD);
 }
コード例 #2
0
ファイル: Route.php プロジェクト: archy-bold/slimvc
 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);
 }