Пример #1
0
 /**
  * @covers ::humanize
  */
 public function testHumanize()
 {
     $errorObjects = [new Error(new Present('name 1', 'test 1 :name')), new Error(new Present('name 2', 'test 2 :name'))];
     $errors = new Errors($errorObjects);
     $this->assertEquals('test 1 name 1, test 2 name 2', $errors->humanize());
 }
Пример #2
0
 /**
  * @param object    $subject
  * @param Errors    $errors
  * @param integer   $code
  * @param Exception $previous
  */
 public function __construct($subject, Errors $errors, $code = 0, Exception $previous = null)
 {
     $this->subject = $subject;
     $this->errors = $errors;
     parent::__construct("Has errors: {$errors->humanize()}", $code, $previous);
 }