/** * @return string * @throws NotFoundException */ protected function getMethodName() { $methodName = 'action' . str_replace(' ', '', ucwords(str_replace(['_', '-', '.'], [' ', ' ', ' '], $this->request->getActionName()))); if (!method_exists($this, $methodName)) { throw new NotFoundException("{$methodName} does not support in " . get_class($this)); } return $methodName; }
/** * @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 $actionName Expected action name * @param string $message Failure message */ public function assertActionName($actionName, $message = null) { $this->assertEquals($actionName, $this->request->getActionName(), $message); }