Example #1
0
 /**
  * @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 [];
     }
 }
Example #2
0
 public function testGetActionNameReturnsIndexWhenNotSet()
 {
     $_REQUEST = [];
     $request = new Request(new Session(), new Cookie());
     $this->assertEquals('index', $request->getActionName());
 }