From 042fedf51cc401127b51569465af2527ae996fcc Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 9 May 2007 13:03:18 +0000 Subject: [PATCH] added new test for checking var against array of valid values; fixed some test not properly working; --- test/PMA_isValid_test.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/PMA_isValid_test.php b/test/PMA_isValid_test.php index 80f910be8..f6f2c1345 100644 --- a/test/PMA_isValid_test.php +++ b/test/PMA_isValid_test.php @@ -71,32 +71,42 @@ class PMA_isValid_test extends PHPUnit_Framework_TestCase public function testNotScalarArray() { $var = array('test'); - $this->assertFalse(PMA_isValid($var), 'scalar'); + $this->assertFalse(PMA_isValid($var, 'scalar')); } public function testNotScalarNull() { $var = null; - $this->assertFalse(PMA_isValid($var), 'scalar'); + $this->assertFalse(PMA_isValid($var, 'scalar')); } public function testNumericInt() { $var = 1; - $this->assertTrue(PMA_isValid($var), 'numeric'); + $this->assertTrue(PMA_isValid($var, 'numeric')); } public function testNumericFloat() { $var = 1.1; - $this->assertTrue(PMA_isValid($var), 'numeric'); + $this->assertTrue(PMA_isValid($var, 'numeric')); } public function testNumericZero() { $var = 0; - $this->assertTrue(PMA_isValid($var), 'numeric'); + $this->assertTrue(PMA_isValid($var, 'numeric')); } public function testNumericString() { $var = '+0.1'; - $this->assertTrue(PMA_isValid($var), 'numeric'); + $this->assertTrue(PMA_isValid($var, 'numeric')); + } + public function testValueInArray() + { + $var = 'a'; + $this->assertTrue(PMA_isValid($var, array('a', 'b', ))); + } + public function testValueNotInArray() + { + $var = 'c'; + $this->assertFalse(PMA_isValid($var, array('a', 'b', ))); } } ?> \ No newline at end of file