Browse files

Revert "simple new method added for validating sort codes."

This reverts commit 23da720.
  • Loading branch information...
1 parent 23da720 commit 01a592c06aa7435581df45ad902e3dc82a3eb31c @kenguest kenguest committed Jan 22, 2013
Showing with 4 additions and 63 deletions.
  1. +0 −17 Validate/IE.php
  2. +4 −4 tests/validate_IE_bankAC.phpt
  3. +0 −42 tests/validate_IE_sortCode.phpt
View
17 Validate/IE.php
@@ -367,23 +367,6 @@ function licensePlate($number)
}
}
// }}}
-
- // {{{ public function sortCode
-
- /**
- * Validate a sort code, no dashes or whitespace - just digits.
- *
- * @param string $sc The sort code.
- *
- * @access public
- * @return bool
- */
- function sortCode($sc)
- {
- // 6 digits expected - starting with a '9'.
- return (preg_match('/^9[0-9]{5}$/', $sc)) ? true : false;
- }
- // }}}
// {{{ public function bankAC
/**
* Validate a bank account number
View
8 tests/validate_IE_bankAC.phpt
@@ -23,11 +23,11 @@ $sort_codes = array(
'123456789', //NOK - too many digits
'1234567', //NOK - too few digits;
);
-echo "\nTest bank accounts prefixed with sort codes\n";
+echo "\nTest bank accounts\n";
foreach ($ACs as $AC) {
echo "{$AC}: ".$noYes[Validate_IE::bankAC($AC)]."\n";
}
-echo "\nTest bank accounts\n";
+echo "\nTest sort codes\n";
foreach ($sort_codes as $sort_code) {
echo "{$sort_code}: ".$noYes[Validate_IE::bankAC($sort_code, true)]."\n";
}
@@ -38,13 +38,13 @@ exit(0);
Test Validate_IE
****************
-Test bank accounts prefixed with sort codes
+Test bank accounts
12345678901234: YES
A2345678901234: NO
123456789012345: NO
12C4567890123: NO
-Test bank accounts
+Test sort codes
12345678: YES
A2345678: NO
123456789: NO
View
42 tests/validate_IE_sortCode.phpt
@@ -1,42 +0,0 @@
---TEST--
-validate_IE_sortCode.phpt: Unit tests for sortCode method of 'Validate/IE.php'
-
---FILE--
-<?php
-// Validate test script
-error_reporting(0);
-$noYes = array('NO', 'YES');
-require_once 'Validate/IE.php';
-
-echo "Test Validate_IE\n";
-echo "****************\n";
-
-//test bank account
-$sort_codes = array(
-'123456', //OK
-'A23456', //NOK - not numeric
-'123456789', //NOK - too many digits
-'1234567', //NOK - too many digits;
-'12345', //NOK - too many digits;
-'000000', // NOK - known to be invalid
-'999999', // NOK - known to be invalid
-);
-echo "\nTest sort codes\n";
-foreach ($sort_codes as $sort_code) {
- echo "{$sort_code}: ".$noYes[Validate_IE::sortCode($sort_code)]."\n";
-}
-exit(0);
-?>
-
---EXPECT--
-Test Validate_IE
-****************
-
-Test sort codes
-123456: YES
-A23456: NO
-123456789: NO
-1234567: NO
-12345: NO
-000000: NO
-999999: NO

0 comments on commit 01a592c

Please sign in to comment.