Example #1
0
 /**
  * test setValidationErrors() method
  *
  * @test
  */
 public function setValidationErrors()
 {
     $this->generateComponent(['mocks' => ['Api' => ['collectValidationErrors', 'recordToParams', 'setResponse']]]);
     $this->Api->expects($this->once())->method('collectValidationErrors')->with(null)->will($this->returnValue(['records']));
     $this->Api->expects($this->once())->method('recordToParams')->with(['records'])->will($this->returnValue('params'));
     $this->Api->expects($this->once())->method('setResponse')->with(['validationErrors' => 'params']);
     $this->Api->setValidationErrors();
 }