Browse Source

Improve wording of credit card data validatoin error message

Marc Würth 2 years ago
parent
commit
43fe8f48c2
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/Validation/Validator.php
  2. 1 1
      tests/TestCase/Validation/ValidatorTest.php

+ 2 - 2
src/Validation/Validator.php

@@ -1262,9 +1262,9 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
     ) {
         if ($message === null) {
             if (!$this->_useI18n) {
-                $message = 'The provided value must be a credit card number';
+                $message = 'The provided value must be a valid credit card number';
             } else {
-                $message = __d('cake', 'The provided value must be a credit card number');
+                $message = __d('cake', 'The provided value must be a valid credit card number');
             }
         }
 

+ 1 - 1
tests/TestCase/Validation/ValidatorTest.php

@@ -1983,7 +1983,7 @@ class ValidatorTest extends TestCase
 
         $fieldName = 'field_name';
         $rule = 'creditCard';
-        $expectedMessage = 'The provided value must be a credit card number';
+        $expectedMessage = 'The provided value must be a valid credit card number';
         $cardType = 'all';
         $this->assertValidationMessage($fieldName, $rule, $expectedMessage, $cardType);
     }