コード例 #1
0
 /**
  * Handle the assertion that the given result object has no errors
  *
  * @param Error\Result $result
  * @param boolean $expectSuccess
  * @return void
  */
 protected function assertSuccess(Error\Result $result, $expectSuccess = true)
 {
     if ($expectSuccess === true) {
         $this->assertFalse($result->hasErrors());
     } else {
         $this->assertTrue($result->hasErrors());
     }
 }
コード例 #2
0
 /**
  * @return boolean TRUE if the argument is valid, FALSE otherwise
  * @api
  * @deprecated Will be removed for next major Flow version.
  */
 public function isValid()
 {
     return !$this->validationResults->hasErrors();
 }
コード例 #3
0
 /**
  * @param Result $validationResult
  * @return void
  */
 protected function assertValidationResultContainsNoErrors(Result $validationResult)
 {
     if ($validationResult->hasErrors()) {
         $errors = $validationResult->getFlattenedErrors();
         /** @var Error $error */
         $output = '';
         foreach ($errors as $path => $pathErrors) {
             foreach ($pathErrors as $error) {
                 $output .= sprintf('%s -> %s' . PHP_EOL, $path, $error->render());
             }
         }
         $this->fail($output);
     }
     $this->assertFalse($validationResult->hasErrors());
 }