Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Complete additionalChars tests as per Alnum see #114

  • Loading branch information...
commit 9be0ee8aac611f13a62a63f18bf74274b18a5a84 1 parent f1f9bc0
@nickl- nickl- authored
View
17 tests/library/Respect/Validation/Rules/AlnumTest.php
@@ -34,6 +34,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Alnum($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Alnum($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} abc 123'),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n abc 123"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/AlphaTest.php
@@ -34,6 +34,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExeption($aditio
$validator = new Alpha($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Alpha($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} abc'),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n abc"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/CntrlTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Cntrl($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Cntrl($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){} ', '!@#$%^&*(){} '),
+ array('[]?+=/\\-_|"\',<>. ', "[]?+=/\\-_|\"',<>. \t \n"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/ConsonantTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Consonant($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Consonant($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} bc dfg'),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n bc dfg"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/DigitTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Digit($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Digit($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} 123'),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n 123"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/GraphTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Graph($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Graph($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array(' ', '!@#$%^&*(){} abc 123'),
+ array(" \t\n", "[]?+=/\\-_|\"',<>. \t \n abc 123"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/PrntTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Prnt($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Prnt($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array("\t\n", "\t\n "),
+ array("\v\r", "\v\r "),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/PunctTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Punct($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Punct($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('abc123 ', '!@#$%^&*(){} abc 123'),
+ array("abc123 \t\n", "[]?+=/\\-_|\"',<>. \t \n abc 123"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/SpaceTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Space($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Space($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} '),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n "),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/VowelTest.php
@@ -32,6 +32,23 @@ public function testInvalidConstructorParamsShouldThrowComponentExceptionUponIns
$validator = new Vowel($aditional);
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Vowel($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){}', '!@#$%^&*(){} aeo iu'),
+ array('[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n aeo iu"),
+ );
+ }
+
public function providerForInvalidParams()
{
return array(
View
17 tests/library/Respect/Validation/Rules/XdigitTest.php
@@ -30,6 +30,23 @@ public function testInvalidHexadecimalDigitsShouldThrowXdigitException($input)
$this->assertFalse($this->xdigitsValidator->assert($input));
}
+ /**
+ * @dataProvider providerAdditionalChars
+ */
+ public function testAdditionalCharsShouldBeRespected($aditional, $query)
+ {
+ $validator = new Xdigit($aditional);
+ $this->assertTrue($validator->validate($query));
+ }
+
+ public function providerAdditionalChars()
+ {
+ return array(
+ array('!@#$%^&*(){} ', '!@#$%^&*(){} abc 123'),
+ array("[]?+=/\\-_|\"',<>. \t\n", "[]?+=/\\-_|\"',<>. \t \n abc 123"),
+ );
+ }
+
public function providerForXdigit()
{
return array(
Please sign in to comment.
Something went wrong with that request. Please try again.