/** * @param null $field * @return array */ public function getErrors($field = null) { if ($this->isSent() && $this->request->getParam($this->name)) { $validator = $this->getValidator(); $validator->validate($this->object); return $validator->getErrors($field); } else { return []; } }
public function testGetActionNameReturnsIndexWhenNotSet() { $_REQUEST = []; $request = new Request(new Session(), new Cookie()); $this->assertEquals('index', $request->getActionName()); }