/** * @return string * @throws NotFoundException */ protected function getMethodName() { $methodName = 'action' . str_replace(' ', '', ucwords(str_replace(['_', '-', '.'], [' ', ' ', ' '], $this->request->getActionName()))); if (!method_exists($this, $methodName)) { $msg = strtr(":controller:::method does not support", [':controller' => $this->request->getControllerName(), ':method' => $methodName]); throw new NotFoundException($msg); } return $methodName; }
/** * @param string $controllerName Expected controller name * @param string $message Fail message */ public function assertControllerName($controllerName, $message = null) { $this->assertEquals($controllerName, $this->request->getControllerName(), $message); }