Fixing missing boolean return in Validation::cc()

Fixing Validation test case to pass under PHPUnit.
This commit is contained in:
mark_story 2010-05-20 22:30:47 -04:00
parent 625d120d74
commit 7cef278ce2
2 changed files with 21 additions and 6 deletions

View file

@ -191,6 +191,7 @@ class Validation {
return self::luhn($check, $deep);
}
}
return false;
}
/**

View file

@ -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');
}
/**