mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 17:42:41 +00:00
Fixing missing boolean return in Validation::cc()
Fixing Validation test case to pass under PHPUnit.
This commit is contained in:
parent
625d120d74
commit
7cef278ce2
2 changed files with 21 additions and 6 deletions
|
@ -191,6 +191,7 @@ class Validation {
|
|||
return self::luhn($check, $deep);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2057,19 +2057,33 @@ class ValidationTest extends CakeTestCase {
|
|||
$this->assertTrue(Validation::ssn('text', null, 'testNl'));
|
||||
}
|
||||
|
||||
/**
|
||||
* test pass through failure on postal
|
||||
*
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @return void
|
||||
*/
|
||||
function testPassThroughMethodFailure() {
|
||||
Validation::phone('text', null, 'testNl');
|
||||
}
|
||||
|
||||
/**
|
||||
* test the pass through calling of an alternate locale with postal()
|
||||
*
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @return void
|
||||
**/
|
||||
function testPassThroughClassFailure() {
|
||||
Validation::postal('text', null, 'AUTOFAIL');
|
||||
}
|
||||
|
||||
/**
|
||||
* test pass through method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPassThroughMethod() {
|
||||
$this->assertTrue(Validation::postal('text', null, 'testNl'));
|
||||
|
||||
$this->expectError('Could not find AUTOFAILValidation class, unable to complete validation.');
|
||||
Validation::postal('text', null, 'AUTOFAIL');
|
||||
|
||||
$this->expectError('Method phone does not exist on TestNlValidation unable to complete validation.');
|
||||
Validation::phone('text', null, 'testNl');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue