Browse Source

Cover default data validation error message without I18n enabled at least once

ravage84 2 years ago
parent
commit
a4428cd9c4
1 changed files with 8 additions and 0 deletions
  1. 8 0
      tests/TestCase/Validation/ValidatorTest.php

+ 8 - 0
tests/TestCase/Validation/ValidatorTest.php

@@ -1497,6 +1497,14 @@ class ValidatorTest extends TestCase
             ],
             ],
         ];
         ];
         $this->assertEquals($expected, $errors);
         $this->assertEquals($expected, $errors);
+
+        $noI18nValidator = new NoI18nValidator();
+        $noI18nValidator
+            ->add('email', 'alpha', ['rule' => 'alphanumeric'])
+            ->add('email', 'notBlank', ['rule' => 'notBlank'])
+            ->add('email', 'email', ['rule' => 'email', 'message' => 'Y u no write email?']);
+        $errors = $noI18nValidator->validate(['email' => 'not an email!']);
+        $this->assertEquals($expected, $errors);
     }
     }
 
 
     /**
     /**