mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Use old array syntax instead of new to keep compatibility
This commit is contained in:
parent
ad0f6b9708
commit
c59cfd54b0
@ -749,6 +749,8 @@ class ValidateTest extends BaseTestCase
|
|||||||
$this->assertFalse($v->validate());
|
$this->assertFalse($v->validate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
public function testCreditCardValid()
|
public function testCreditCardValid()
|
||||||
{
|
{
|
||||||
$visa = array(4539511619543489, 4532949059629052, 4024007171194938, 4929646403373269, 4539135861690622);
|
$visa = array(4539511619543489, 4532949059629052, 4024007171194938, 4929646403373269, 4539135861690622);
|
||||||
@ -800,31 +802,32 @@ class ValidateTest extends BaseTestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public function testInstanceOfValidWithString()
|
public function testInstanceOfValidWithString()
|
||||||
{
|
{
|
||||||
$v = new Validator(['attributeName' => new stdClass()]);
|
$v = new Validator(array('attributeName' => new stdClass()));
|
||||||
$v->rule('instanceOf', 'attributeName', 'stdClass');
|
$v->rule('instanceOf', 'attributeName', 'stdClass');
|
||||||
$this->assertTrue($v->validate());
|
$this->assertTrue($v->validate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInstanceOfInvalidWithInstance()
|
public function testInstanceOfInvalidWithInstance()
|
||||||
{
|
{
|
||||||
$v = new Validator(['attributeName' => new stdClass()]);
|
$v = new Validator(array('attributeName' => new stdClass()));
|
||||||
$v->rule('instanceOf', 'attributeName', new Validator([]));
|
$v->rule('instanceOf', 'attributeName', new Validator(array()));
|
||||||
$this->assertFalse($v->validate());
|
$this->assertFalse($v->validate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInstanceOfValidWithInstance()
|
public function testInstanceOfValidWithInstance()
|
||||||
{
|
{
|
||||||
$v = new Validator(['attributeName' => new stdClass()]);
|
$v = new Validator(array('attributeName' => new stdClass()));
|
||||||
$v->rule('instanceOf', 'attributeName', new stdClass());
|
$v->rule('instanceOf', 'attributeName', new stdClass());
|
||||||
$this->assertTrue($v->validate());
|
$this->assertTrue($v->validate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInstanceOfInvalidWithString()
|
public function testInstanceOfInvalidWithString()
|
||||||
{
|
{
|
||||||
$v = new Validator(['attributeName' => new stdClass()]);
|
$v = new Validator(array('attributeName' => new stdClass()));
|
||||||
$v->rule('instanceOf', 'attributeName', 'SomeOtherClass');
|
$v->rule('instanceOf', 'attributeName', 'SomeOtherClass');
|
||||||
$this->assertFalse($v->validate());
|
$this->assertFalse($v->validate());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user