cvs: pear /Validate/tests validate_BE_national_id.phpt validate_BE_phone_numbers.phpt

From: Date: Fri, 30 Sep 2005 19:27:42 +0000
Subject: cvs: pear /Validate/tests validate_BE_national_id.phpt validate_BE_phone_numbers.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35193@lists.php.net to get a copy of this message
moosh Fri Sep 30 15:27:42 2005 EDT Added files: /pear/Validate/tests validate_BE_national_id.phpt validate_BE_phone_numbers.phpt Log: - finish all tests http://cvs.php.net/co.php/pear/Validate/tests/validate_BE_national_id.phpt?r=1.1&p=1 Index: pear/Validate/tests/validate_BE_national_id.phpt +++ pear/Validate/tests/validate_BE_national_id.phpt --TEST-- validate_BE.phpt: Unit tests for 'Validate/BE.php' --FILE-- <?php include (dirname(__FILE__).'/validate_BE_functions.inc.php'); require_once 'Validate/BE.php'; $nationalIdList = array( '73011136173' => 'OK' , '73.01.11.361-73' => 'OK' , '730111-361-73' => 'OK' , '730111-361-73' => 'OK' , '730111-361-99' => 'KO' , '730211-361-99' => 'KO' ); $functionToTest = 'nationalId'; $title = 'Test Validate_BE::' . $functionToTest . '()'; echo $title . "\n"; echo str_pad('',strlen($title),'*') . "\n"; echo (test_func($functionToTest, $nationalIdList )) ? '... FAILED' : '... SUCCESS'; ?> --EXPECT-- Test Validate_BE::nationalId() ****************************** --------- Test nationalId _ Value State Return V = validation result is right X = validation result is wrong V 73011136173 : KO KO V 73.01.11.361-73' : KO KO V 730111-361-73 : OK OK V 730111-361-73 : OK OK V 730111-361-99 : KO KO V 730211-361-99 : KO KO.... SUCCESS http://cvs.php.net/co.php/pear/Validate/tests/validate_BE_phone_numbers.phpt?r=1.1&p=1 Index: pear/Validate/tests/validate_BE_phone_numbers.phpt +++ pear/Validate/tests/validate_BE_phone_numbers.phpt --TEST-- validate_BE_phone_numbers: Unit tests for phoneNumber method in 'Validate/BE.php' --FILE-- <?php include (dirname(__FILE__).'/validate_BE_functions.inc.php'); require_once 'Validate/BE.php'; $phoneNumberList = array( '065 12 34 56' => 'OK'// national little zone (phone number with 6 number) , '02 123 45 67' => 'OK'// national big zone (phone number with 6 number) , '0485 12 34 56' => 'OK'// GSM , '00 32 65 12 34 56' => 'OK'// national little zone (phone number with 6 number) , '00 32 2 123 45 67' => 'OK'// national big zone (phone number with 6 number) , '00 32 485 12 34 56' => 'OK'// GSM , '+32 65 12 34 56' => 'OK' , '+32 2 123 45 67' => 'OK' , '+32 485 12 34 56' => 'OK' , '++ 32 65 12 34 56' => 'OK' , '++ 32 2 123 45 67' => 'OK' , '++ 32 485 12 34 56' => 'OK' , '02 1a3 45 67' => 'KO' , '0485 a2 34 56' => 'KO' , '00 32 a5 12 34 56' => 'KO' , '00 32 a 123 45 67' => 'KO' , '00 32 4a5 12 34 56' => 'KO' , '017 12 34 56' => 'KO'// national little zone (phone number with 6 number) but this prefix don't exist in belgium , '+ 32 6a 12 34 56' => 'KO' , '+ 32 2 1a3 45 67' => 'KO' , '+ 32 485 1a 34 56' => 'KO' , '++ 32 65 1a 34 56' => 'KO' , '++ 32 2 1a3 45 67' => 'KO' , '++ 32 485 1a 34 56' => 'KO' , '02 12 45 67' => 'KO' , '0485 112 34 56' => 'KO' , '00 32 5 12 34 56' => 'KO' , '00 32 12 123 45 67' => 'KO' , '00 32 45 12 34 56' => 'OK' , '+ 32 651 12 34 56' => 'KO' , '+ 32 2 13 45 67' => 'KO' , '+ 32 4851 12 34 56' => 'KO' , '++ 32 65 112 34 56' => 'KO' , '++ 32 2 1213 45 67' => 'KO' , '++ 32 485 112 34 56' => 'KO' ); $functionToTest = 'phoneNumber'; $title = 'Test Validate_BE::' . $functionToTest . '()'; echo $title . "\n"; echo str_pad('',strlen($title),'*') . "\n"; echo (test_func($functionToTest, $phoneNumberList )) ? '... FAILED' : '... SUCCESS'; ?> --EXPECT-- Test Validate_BE::phoneNumber() ******************************* --------- Test phoneNumber _ Value State Return V = validation result is right X = validation result is wrong V 065 12 34 56 : OK OK V 02 123 45 67 : OK OK V 0485 12 34 56 : OK OK V 00 32 65 12 34 56 : OK OK V 00 32 2 123 45 67 : OK OK V 00 32 485 12 34 56 : OK OK V +32 65 12 34 56 : OK OK V +32 2 123 45 67 : OK OK V +32 485 12 34 56 : OK OK V ++ 32 65 12 34 56 : OK OK V ++ 32 2 123 45 67 : OK OK V ++ 32 485 12 34 56 : OK OK V 02 1a3 45 67 : KO KO V 0485 a2 34 56 : KO KO V 00 32 a5 12 34 56 : KO KO V 00 32 a 123 45 67 : KO KO V 00 32 4a5 12 34 56 : KO KO V 017 12 34 56 : KO KO V + 32 6a 12 34 56 : KO KO V + 32 2 1a3 45 67 : KO KO V + 32 485 1a 34 56 : KO KO V ++ 32 65 1a 34 56 : KO KO V ++ 32 2 1a3 45 67 : KO KO V ++ 32 485 1a 34 56 : KO KO V 02 12 45 67 : KO KO V 0485 112 34 56 : KO KO V 00 32 5 12 34 56 : KO KO V 00 32 12 123 45 67 : KO KO V 00 32 45 12 34 56 : OK OK V + 32 651 12 34 56 : KO KO V + 32 2 13 45 67 : KO KO V + 32 4851 12 34 56 : KO KO V ++ 32 65 112 34 56 : KO KO V ++ 32 2 1213 45 67 : KO KO V ++ 32 485 112 34 56 : KO KO.... SUCCESS

« previous php.pear.cvs (#35193) next »