コード例 #1
0
ファイル: BuiltInTest.php プロジェクト: maslosoft/mangantest
 public function testIfWillSetErrorsWithExternalValidatorCallToDocumentInstance()
 {
     $model = new DocumentWithRequiredValidator();
     $validator = new Validator($model);
     // Should not pass validation
     $this->assertFalse($validator->validate());
     $errors = $model->getErrors();
     codecept_debug('Error message is: ' . $errors['login'][0]);
     $this->assertGreaterThan(0, count($errors));
     $this->assertSame(1, count($errors['login']));
     $this->assertTrue(is_string($errors['login'][0]));
 }