mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Uncomment CC test cases and add alternative syntax tests
This commit is contained in:
parent
c59cfd54b0
commit
be9d21399c
@ -749,8 +749,6 @@ class ValidateTest extends BaseTestCase
|
||||
$this->assertFalse($v->validate());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
public function testCreditCardValid()
|
||||
{
|
||||
$visa = array(4539511619543489, 4532949059629052, 4024007171194938, 4929646403373269, 4539135861690622);
|
||||
@ -802,7 +800,6 @@ class ValidateTest extends BaseTestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public function testInstanceOfValidWithString()
|
||||
{
|
||||
@ -832,6 +829,29 @@ class ValidateTest extends BaseTestCase
|
||||
$this->assertFalse($v->validate());
|
||||
}
|
||||
|
||||
public function testInstanceOfWithAlternativeSyntaxValid()
|
||||
{
|
||||
$v = new Validator(array('attributeName' => new stdClass()));
|
||||
$v->rules(array(
|
||||
'instanceOf' => array(
|
||||
array('attributeName', 'stdClass')
|
||||
)
|
||||
));
|
||||
$this->assertTrue($v->validate());
|
||||
}
|
||||
|
||||
public function testInstanceOfWithAlternativeSyntaxInvalid()
|
||||
{
|
||||
$v = new Validator(array('attributeName' => new stdClass()));
|
||||
$v->rules(array(
|
||||
'instanceOf' => array(
|
||||
array('attributeName', 'SomeOtherClassInAlternativeSyntaxInvalid')
|
||||
)
|
||||
));
|
||||
$v->validate();
|
||||
$this->assertFalse($v->validate());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function sampleFunctionCallback($field, $value, array $params) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user