Skip to content

Commit

Permalink
update-docs; fixing regex after mass replacing php 5.4 array with php…
Browse files Browse the repository at this point in the history
… 5.3 array
  • Loading branch information
mangopeaches committed Oct 13, 2018
1 parent 4b60bef commit 3f19217
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/Valitron/ValidateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function testEqualsInvalidAltSyntax()
array('password', 'confirmPassword')
)
));
$this->assertFalse($v->validate());
}

public function testEqualsBothNull()
Expand Down Expand Up @@ -1358,7 +1359,7 @@ public function testNoErrorFailOnArray()
public function testRegexValid()
{
$v = new Validator(array('test' => '42'));
$v->rule('regex', 'test', '/array(\d)+/');
$v->rule('regex', 'test', '/[\d]+/');
$this->assertTrue($v->validate());
}

Expand All @@ -1367,7 +1368,7 @@ public function testRegexValidAltSyntax()
$v = new Valitron\Validator(array('username' => 'Batman123'));
$v->rules(array(
'regex' => array(
array('username', '/^array(a-zA-Z0-9){5,10}$/')
array('username', '/^[a-zA-Z0-9]{5,10}$/')
)
));
$this->assertTrue($v->validate());
Expand All @@ -1376,7 +1377,7 @@ public function testRegexValidAltSyntax()
public function testRegexInvalid()
{
$v = new Validator(array('test' => 'istheanswer'));
$v->rule('regex', 'test', '/array(\d)+/');
$v->rule('regex', 'test', '/[\d]+/');
$this->assertFalse($v->validate());
}

Expand All @@ -1385,7 +1386,7 @@ public function testRegexInvalidAltSyntax()
$v = new Valitron\Validator(array('username' => 'Batman_123'));
$v->rules(array(
'regex' => array(
array('username', '/^array(a-zA-Z0-9){5,10}$/')
array('username', '/^[a-zA-Z0-9]{5,10}$/')
)
));
$this->assertFalse($v->validate());
Expand Down

0 comments on commit 3f19217

Please sign in to comment.