From 11b84d24056c9517119ce13893ed2d2e11d44885 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 26 Nov 2011 19:34:01 +1030 Subject: [PATCH] Shifted Validate_AU to seperate location --- Validate/AU.php | 339 --- data/AU_postcodes.txt | 3316 -------------------------- docs/validate_au_fetch_postcodes.php | 104 - package_AU.xml | 115 - tests/validate_AU.phpt | 308 --- 5 files changed, 4182 deletions(-) delete mode 100644 Validate/AU.php delete mode 100644 data/AU_postcodes.txt delete mode 100644 docs/validate_au_fetch_postcodes.php delete mode 100644 package_AU.xml delete mode 100644 tests/validate_AU.phpt diff --git a/Validate/AU.php b/Validate/AU.php deleted file mode 100644 index 9a9f1df..0000000 --- a/Validate/AU.php +++ /dev/null @@ -1,339 +0,0 @@ - - * @author Tho Nguyen - * @author Alex Hayes - * @author Byron Adams - * @copyright 1997-2005 Daniel O'Connor - * @copyright 2006 Alex Hayes - * @copyright 2006 Byron Adams - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id$ - * @link http://pear.php.net/package/Validate_AU - */ - -/** - * Data validation class for Australia - * - * Contains code from Validate_AT, Validate_UK and Validate_NZ - * - * This class provides methods to validate: - * - Postal code - * - Phone number - * - Australian Business Number - * - Australian Company Number - * - Tax File Number - * - Australian Regional codes - * - * @category Validate - * @package Validate_AU - * @author Daniel O'Connor - * @author Tho Nguyen - * @author Alex Hayes - * @author Byron Adams - * @copyright 1997-2005 Daniel O'Connor - * @copyright 2006 Alex Hayes - * @copyright 2006 Byron Adams - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/Validate_AU - */ - -class Validate_AU -{ - - /** - * Validate Austrialian postal codes. - * - * @param string $postcode postcode to validate - * @param bool $strong optional; strong checks against a list of postcodes - * @param string $dataDir optional; name of directory datafile is located in - * - * @access public - * @static string $postcodes - * @return bool true if postcode is ok, false otherwise - */ - function postalCode($postcode, $strong = false, $dataDir = null) - { - if ($strong) { - static $postcodes; - - if (!isset($postcodes)) { - if ($dataDir != null && (is_file($dataDir . '/AU_postcodes.txt'))) { - $file = $dataDir . '/AU_postcodes.txt'; - } else { - $file = '@DATADIR@/Validate_AU/data/AU_postcodes.txt'; - } - $postcodes = array_map('trim', file($file)); - } - - return in_array((string)$postcode, $postcodes, true); - } - return preg_match('(^[0-9]{4}$)', $postcode); - } - - /** - * Validates Australian Regional Codes - * - * @param string $region regional code to validate - * - * @access public - * @static array $regions - * @return bool Returns true on success, false otherwise - */ - function region($region) - { - static $regions = array("ACT", "NSW", "NT", "QLD", "SA", "TAS", "VIC", "WA"); - return in_array(strtoupper($region), $regions); - } - - /** - * Validate a telephone number. - * - * Note that this function supports the following notations: - * - * - Landline: 03 9999 9999 - * - Mobile: 0400 000 000 (as above, but usually notated differently) - * - Indial: 131 812 / 1300 000 000 / 1800 000 000 / 1900 000 000 - * - International: +61.3 9999 9999 - * - * For International numbers, only +61 will be valid, as this is - * Australia's dial code, and the format MUST be +61.3, where 3 represents - * the state dial code, in this case, Victoria. - * - * Note: If the VALIDATE_AU_PHONENUMBER_STRICT flag is not supplied, then - * all spaces, dashes and parenthesis are removed before validation. You - * will have to strip these yourself if your data storage does not allow - * these characters. - * - * @param string $number The telephone number - * @param mixed[] $options A list of options - * 'strict' => true - do not common characters - * 'national' => true - validate national numbers - * 'indial' => true - 13, 1300, 1800, 1900 - * numbers - * 'other' => true - uncommon phone validations - * like premium sms, data and personal numbers - * 'international => true - international numbers - * for Australia (eg. +61.3 9999 9999) - * - * @static - * @access public - * @return bool - * - * @todo Check that $flags contains a valid flag. - */ - function phoneNumber($number, $options = array('strict' => false, - 'national' => true, - 'indial' => true, - 'international' => true, - 'other' => true)) - { - - $preg = array(); - if (empty($options['strict'])) { - $number = str_replace(array('(', ')', '-', ' '), '', $number); - } - - if (!empty($options['national'])) { - $preg[] = "(0[3478][0-9]{8})"; - $preg[] = "(02[3-9][0-9]{7})"; - } - - if (!empty($options['indial'])) { - $preg[] = '(13[0-9]{4})'; - $preg[] = "(1[3|8|9]00[0-9]{6})"; - } - - if (!empty($options['international'])) { - $preg[] = "(\+61\.[23478][0-9]{8})"; - } - - //Other numbers, like premium SMS - if (!empty($options['other'])) { - - //Premium SMS - $preg[] = "(19[0-9]{4,6})"; - - //Universial Personal Phones - $preg[] = "(0550[0-9]{6})"; //VOIP range (proposed) - $preg[] = "(059[0-9]{7})"; //Enum testing numbers - $preg[] = "(0500[0-9]{6})"; //"Find me anywhere" - //(divert the number and - // the caller pays the bill) - - - - //Data access providers - $preg[] = "(0198[0-3][0-9]{5})"; - - } - - if (!empty($preg)) { - foreach ($preg as $pattern) { - if (preg_match("/^" . $pattern . "$/", $number)) { - return true; - } - } - } - - return false; - - } - - /** - * Validate an Australian Company Number (ACN) - * - * The ACN is a nine digit number with the last digit - * being a check digit calculated using a modified - * modulus 10 calculation. - * - * @param string $acn ACN number to validate - * - * @access public - * @return bool Returns true on success, false otherwise - * @link http://www.asic.gov.au/asic/asic_infoco.nsf/byheadline/Australian+Company+Number+(ACN)+Check+Digit - */ - function acn($acn) - { - $weights = array(8, 7, 6, 5, 4, 3, 2, 1, 0); - - $acn = preg_replace("/[^\d]/", "", $acn); - $digits = str_split($acn); - $sum = 0; - - if (!ctype_digit($acn) || strlen($acn) != 9) { - return false; - } - - foreach ($digits as $key => $digit) { - $sum += $digit * $weights[$key]; - } - - $remainder = $sum % 10; - - switch ($remainder) { - case 0: - $complement = 0 - $remainder; - break; - default: - $complement = 10 - $remainder; - break; - } - - return ($digits[8] == $complement); - } - - /** - * Social Security Number. - * - * Australia does not have a social security number system, - * the closest equivalent is a Tax File Number - * - * @param string $ssn ssn number to validate - * - * @access public - * @see Validate_AU::tfn() - * @return bool Returns true on success, false otherwise - */ - function ssn($ssn) - { - return Validate_AU::tfn($ssn); - } - - /** - * Tax File Number (TFN) - * - * Australia does not have a social security number system, - * the closest equivalent is a Tax File Number. - * - * @param string $tfn Tax File Number - * - * @access public - * @return bool Returns true on success, false otherwise - * @link http://en.wikipedia.org/wiki/Tax_File_Number - */ - function tfn($tfn) - { - $weights = array(1, 4, 3, 7, 5, 8, 6, 9, 10); - $length = array("8", "9"); - - $tfn = preg_replace("/[^\d]/", "", $tfn); - $tfn = str_split($tfn); - - return Validate_AU::checkDigit($tfn, 11, $weights, $length); - } - - /** - * Australian Business Number (ABN). - * - * Validates an ABN using a modulus calculation - * - * @param string $abn ABN to validate - * - * @static - * @access public - * @return bool true on success, otherwise false - * @link http://www.ato.gov.au/businesses/content.asp?doc=/content/13187.htm - */ - function abn($abn) - { - $weights = array(10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19); - $length = array("11"); - - $abn = preg_replace("/[^\d]/", "", $abn); - $abn = str_split($abn); - $abn[0]--; - - return Validate_AU::checkDigit($abn, 89, $weights, $length); - } - - /** - * Validate number against decimal checksum (check digit) - * - * A check digit is a form of redundancy check used - * for error detection, the decimal equivalent of a - * binary checksum. It consists of a single digit - * computed from the other digits in the message. - * - * @param array $digits Digits to check - * @param int $modulus Modulus - * @param array $weights Array containing weighting - * @param array $length Length - * - * @access public - * @return bool true on success, otherwise false - * @link http://en.wikipedia.org/wiki/Check_digit - */ - function checkDigit($digits, $modulus, $weights, $length) - { - $sum = 0; - - if (!in_array(count($digits), $length)) { - return false; - } - - foreach ($digits as $key => $digit) { - $sum += $digit * $weights[$key]; - } - - return !($sum % $modulus); - - } -} -?> diff --git a/data/AU_postcodes.txt b/data/AU_postcodes.txt deleted file mode 100644 index 1714295..0000000 --- a/data/AU_postcodes.txt +++ /dev/null @@ -1,3316 +0,0 @@ -0200 -0221 -0800 -0801 -0804 -0810 -0811 -0812 -0813 -0814 -0815 -0820 -0821 -0822 -0828 -0829 -0830 -0831 -0832 -0835 -0836 -0837 -0838 -0840 -0841 -0845 -0846 -0847 -0850 -0851 -0852 -0853 -0854 -0860 -0861 -0862 -0870 -0871 -0872 -0880 -0881 -0885 -0886 -0906 -0907 -0909 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1020 -1021 -1022 -1023 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1100 -1101 -1105 -1106 -1107 -1108 -1109 -1110 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1340 -1350 -1355 -1360 -1391 -1401 -1416 -1419 -1420 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1435 -1440 -1441 -1445 -1450 -1455 -1460 -1465 -1466 -1470 -1475 -1476 -1480 -1481 -1484 -1485 -1487 -1490 -1493 -1495 -1499 -1515 -1560 -1565 -1570 -1582 -1585 -1590 -1595 -1597 -1602 -1608 -1610 -1611 -1630 -1635 -1639 -1640 -1655 -1658 -1660 -1670 -1675 -1680 -1685 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1710 -1712 -1715 -1730 -1740 -1741 -1750 -1755 -1765 -1771 -1781 -1790 -1797 -1800 -1805 -1811 -1816 -1819 -1825 -1826 -1830 -1831 -1835 -1848 -1851 -1860 -1871 -1875 -1885 -1888 -1890 -1891 -1900 -1902 -2000 -2001 -2002 -2004 -2006 -2007 -2008 -2009 -2010 -2011 -2012 -2013 -2015 -2016 -2017 -2018 -2019 -2020 -2021 -2022 -2023 -2024 -2025 -2026 -2027 -2028 -2029 -2030 -2031 -2032 -2033 -2034 -2035 -2036 -2037 -2038 -2039 -2040 -2041 -2042 -2043 -2044 -2045 -2046 -2047 -2048 -2049 -2050 -2052 -2055 -2057 -2058 -2059 -2060 -2061 -2062 -2063 -2064 -2065 -2066 -2067 -2068 -2069 -2070 -2071 -2072 -2073 -2074 -2075 -2076 -2077 -2079 -2080 -2081 -2082 -2083 -2084 -2085 -2086 -2087 -2088 -2089 -2090 -2091 -2092 -2093 -2094 -2095 -2096 -2097 -2099 -2100 -2101 -2102 -2103 -2104 -2105 -2106 -2107 -2108 -2109 -2110 -2111 -2112 -2113 -2114 -2115 -2116 -2117 -2118 -2119 -2120 -2121 -2122 -2123 -2124 -2125 -2126 -2127 -2128 -2129 -2130 -2131 -2132 -2133 -2134 -2135 -2136 -2137 -2138 -2139 -2140 -2141 -2142 -2143 -2144 -2145 -2146 -2147 -2148 -2150 -2151 -2152 -2153 -2154 -2155 -2156 -2157 -2158 -2159 -2160 -2161 -2162 -2163 -2164 -2165 -2166 -2167 -2168 -2170 -2171 -2172 -2173 -2174 -2175 -2176 -2177 -2178 -2179 -2190 -2191 -2192 -2193 -2194 -2195 -2196 -2197 -2198 -2199 -2200 -2203 -2204 -2205 -2206 -2207 -2208 -2209 -2210 -2211 -2212 -2213 -2214 -2216 -2217 -2218 -2219 -2220 -2221 -2222 -2223 -2224 -2225 -2226 -2227 -2228 -2229 -2230 -2231 -2232 -2233 -2234 -2250 -2251 -2252 -2256 -2257 -2258 -2259 -2260 -2261 -2262 -2263 -2264 -2265 -2267 -2278 -2280 -2281 -2282 -2283 -2284 -2285 -2286 -2287 -2289 -2290 -2291 -2292 -2293 -2294 -2295 -2296 -2297 -2298 -2299 -2300 -2302 -2303 -2304 -2305 -2306 -2307 -2308 -2309 -2310 -2311 -2312 -2314 -2315 -2316 -2317 -2318 -2319 -2320 -2321 -2322 -2323 -2324 -2325 -2326 -2327 -2328 -2329 -2330 -2331 -2333 -2334 -2335 -2336 -2337 -2338 -2339 -2340 -2341 -2342 -2343 -2344 -2345 -2346 -2347 -2348 -2350 -2351 -2352 -2353 -2354 -2355 -2356 -2357 -2358 -2359 -2360 -2361 -2365 -2369 -2370 -2371 -2372 -2379 -2380 -2381 -2382 -2386 -2387 -2388 -2390 -2395 -2396 -2397 -2398 -2399 -2400 -2401 -2402 -2403 -2404 -2405 -2406 -2408 -2409 -2410 -2411 -2415 -2420 -2421 -2422 -2423 -2424 -2425 -2426 -2427 -2428 -2429 -2430 -2431 -2439 -2440 -2441 -2442 -2443 -2444 -2445 -2446 -2447 -2448 -2449 -2450 -2452 -2453 -2454 -2455 -2456 -2460 -2462 -2463 -2464 -2465 -2466 -2469 -2470 -2471 -2472 -2473 -2474 -2475 -2476 -2477 -2478 -2479 -2480 -2481 -2482 -2483 -2484 -2485 -2486 -2487 -2488 -2489 -2490 -2500 -2502 -2505 -2506 -2508 -2515 -2516 -2517 -2518 -2519 -2520 -2522 -2525 -2526 -2527 -2528 -2529 -2530 -2533 -2534 -2535 -2536 -2537 -2538 -2539 -2540 -2541 -2545 -2546 -2548 -2549 -2550 -2551 -2555 -2556 -2557 -2558 -2559 -2560 -2563 -2564 -2565 -2566 -2567 -2568 -2569 -2570 -2571 -2572 -2573 -2574 -2575 -2576 -2577 -2578 -2579 -2580 -2581 -2582 -2583 -2584 -2585 -2586 -2587 -2588 -2590 -2594 -2600 -2601 -2602 -2603 -2604 -2605 -2606 -2607 -2608 -2609 -2610 -2611 -2612 -2614 -2615 -2616 -2617 -2618 -2619 -2620 -2621 -2622 -2623 -2624 -2625 -2626 -2627 -2628 -2629 -2630 -2631 -2632 -2633 -2640 -2641 -2642 -2643 -2644 -2645 -2646 -2647 -2648 -2649 -2650 -2651 -2652 -2653 -2655 -2656 -2658 -2659 -2660 -2661 -2663 -2665 -2666 -2668 -2669 -2671 -2672 -2675 -2678 -2680 -2681 -2700 -2701 -2702 -2703 -2705 -2706 -2707 -2708 -2710 -2711 -2712 -2713 -2714 -2715 -2716 -2717 -2720 -2721 -2722 -2725 -2726 -2727 -2729 -2730 -2731 -2732 -2733 -2734 -2735 -2736 -2737 -2738 -2739 -2745 -2747 -2748 -2749 -2750 -2751 -2752 -2753 -2754 -2755 -2756 -2757 -2758 -2759 -2760 -2761 -2762 -2763 -2765 -2766 -2767 -2768 -2769 -2770 -2773 -2774 -2775 -2776 -2777 -2778 -2779 -2780 -2782 -2783 -2784 -2785 -2786 -2787 -2790 -2791 -2792 -2793 -2794 -2795 -2796 -2797 -2798 -2799 -2800 -2803 -2804 -2805 -2806 -2807 -2808 -2809 -2810 -2820 -2821 -2823 -2824 -2825 -2827 -2828 -2829 -2830 -2831 -2832 -2833 -2834 -2835 -2836 -2839 -2840 -2842 -2843 -2844 -2845 -2846 -2847 -2848 -2849 -2850 -2852 -2864 -2865 -2866 -2867 -2868 -2869 -2870 -2871 -2873 -2874 -2875 -2876 -2877 -2878 -2879 -2880 -2890 -2891 -2898 -2899 -2900 -2901 -2902 -2903 -2904 -2905 -2906 -2911 -2912 -2913 -2914 -3000 -3001 -3002 -3003 -3004 -3005 -3006 -3008 -3010 -3011 -3012 -3013 -3015 -3016 -3018 -3019 -3020 -3021 -3022 -3023 -3024 -3025 -3026 -3027 -3028 -3029 -3030 -3031 -3032 -3033 -3034 -3036 -3037 -3038 -3039 -3040 -3041 -3042 -3043 -3044 -3045 -3046 -3047 -3048 -3049 -3050 -3051 -3052 -3053 -3054 -3055 -3056 -3057 -3058 -3059 -3060 -3061 -3062 -3063 -3064 -3065 -3066 -3067 -3068 -3070 -3071 -3072 -3073 -3074 -3075 -3076 -3078 -3079 -3081 -3082 -3083 -3084 -3085 -3086 -3087 -3088 -3089 -3090 -3091 -3093 -3094 -3095 -3096 -3097 -3099 -3101 -3102 -3103 -3104 -3105 -3106 -3107 -3108 -3109 -3110 -3111 -3113 -3114 -3115 -3116 -3121 -3122 -3123 -3124 -3125 -3126 -3127 -3128 -3129 -3130 -3131 -3132 -3133 -3134 -3135 -3136 -3137 -3138 -3139 -3140 -3141 -3142 -3143 -3144 -3145 -3146 -3147 -3148 -3149 -3150 -3151 -3152 -3153 -3154 -3155 -3156 -3158 -3159 -3160 -3161 -3162 -3163 -3164 -3165 -3166 -3167 -3168 -3169 -3170 -3171 -3172 -3173 -3174 -3175 -3176 -3177 -3178 -3179 -3180 -3181 -3182 -3183 -3184 -3185 -3186 -3187 -3188 -3189 -3190 -3191 -3192 -3193 -3194 -3195 -3196 -3197 -3198 -3199 -3200 -3201 -3202 -3204 -3205 -3206 -3207 -3211 -3212 -3214 -3215 -3216 -3217 -3218 -3219 -3220 -3221 -3222 -3223 -3224 -3225 -3226 -3227 -3228 -3230 -3231 -3232 -3233 -3235 -3236 -3237 -3238 -3239 -3240 -3241 -3242 -3243 -3249 -3250 -3251 -3254 -3260 -3264 -3265 -3266 -3267 -3268 -3269 -3270 -3271 -3272 -3273 -3274 -3275 -3276 -3277 -3278 -3279 -3280 -3281 -3282 -3283 -3284 -3285 -3286 -3287 -3289 -3292 -3293 -3294 -3300 -3301 -3302 -3303 -3304 -3305 -3309 -3310 -3311 -3312 -3314 -3315 -3317 -3318 -3319 -3321 -3322 -3323 -3324 -3325 -3328 -3329 -3330 -3331 -3332 -3333 -3334 -3335 -3337 -3338 -3340 -3341 -3342 -3345 -3350 -3351 -3352 -3353 -3354 -3355 -3356 -3357 -3360 -3361 -3363 -3364 -3370 -3371 -3373 -3374 -3375 -3377 -3378 -3379 -3380 -3381 -3384 -3385 -3387 -3388 -3390 -3391 -3392 -3393 -3395 -3396 -3400 -3401 -3402 -3407 -3409 -3412 -3413 -3414 -3415 -3418 -3419 -3420 -3423 -3424 -3427 -3428 -3429 -3430 -3431 -3432 -3433 -3434 -3435 -3437 -3438 -3440 -3441 -3442 -3444 -3446 -3447 -3448 -3450 -3451 -3453 -3458 -3460 -3461 -3462 -3463 -3464 -3465 -3467 -3468 -3469 -3472 -3475 -3477 -3478 -3480 -3482 -3483 -3485 -3487 -3488 -3489 -3490 -3491 -3494 -3496 -3498 -3500 -3501 -3502 -3505 -3506 -3507 -3509 -3512 -3515 -3516 -3517 -3518 -3520 -3521 -3522 -3523 -3525 -3527 -3529 -3530 -3531 -3533 -3537 -3540 -3542 -3544 -3546 -3549 -3550 -3551 -3552 -3554 -3555 -3556 -3557 -3558 -3559 -3561 -3562 -3563 -3564 -3565 -3566 -3567 -3568 -3570 -3571 -3572 -3573 -3575 -3576 -3579 -3580 -3581 -3583 -3584 -3585 -3586 -3588 -3589 -3590 -3591 -3594 -3595 -3596 -3597 -3599 -3607 -3608 -3610 -3612 -3614 -3616 -3617 -3618 -3619 -3620 -3621 -3622 -3623 -3624 -3629 -3630 -3631 -3632 -3633 -3634 -3635 -3636 -3637 -3638 -3639 -3640 -3641 -3643 -3644 -3646 -3647 -3649 -3658 -3659 -3660 -3661 -3662 -3663 -3664 -3665 -3666 -3669 -3670 -3671 -3672 -3673 -3675 -3676 -3677 -3678 -3682 -3683 -3685 -3687 -3688 -3689 -3690 -3691 -3694 -3695 -3697 -3698 -3699 -3700 -3701 -3704 -3705 -3707 -3708 -3709 -3711 -3712 -3713 -3714 -3715 -3717 -3718 -3719 -3720 -3722 -3723 -3724 -3725 -3726 -3727 -3728 -3730 -3732 -3733 -3735 -3736 -3737 -3738 -3739 -3740 -3741 -3744 -3746 -3747 -3749 -3750 -3751 -3752 -3753 -3754 -3755 -3756 -3757 -3758 -3759 -3760 -3761 -3762 -3763 -3764 -3765 -3766 -3767 -3770 -3775 -3777 -3778 -3779 -3781 -3782 -3783 -3785 -3786 -3787 -3788 -3789 -3791 -3792 -3793 -3795 -3796 -3797 -3799 -3800 -3802 -3803 -3804 -3805 -3806 -3807 -3808 -3809 -3810 -3812 -3813 -3814 -3815 -3816 -3818 -3820 -3821 -3822 -3823 -3824 -3825 -3831 -3832 -3833 -3835 -3840 -3841 -3842 -3844 -3847 -3850 -3851 -3852 -3853 -3854 -3856 -3857 -3858 -3859 -3860 -3862 -3864 -3865 -3869 -3870 -3871 -3873 -3874 -3875 -3878 -3880 -3882 -3885 -3886 -3887 -3888 -3889 -3890 -3891 -3892 -3893 -3895 -3896 -3898 -3900 -3902 -3903 -3904 -3909 -3910 -3911 -3912 -3913 -3915 -3916 -3918 -3919 -3920 -3921 -3922 -3923 -3925 -3926 -3927 -3928 -3929 -3930 -3931 -3933 -3934 -3936 -3937 -3938 -3939 -3940 -3941 -3942 -3943 -3944 -3945 -3946 -3950 -3951 -3953 -3954 -3956 -3957 -3958 -3959 -3960 -3962 -3964 -3965 -3966 -3967 -3971 -3975 -3976 -3977 -3978 -3979 -3980 -3981 -3984 -3987 -3988 -3990 -3991 -3992 -3995 -3996 -4000 -4001 -4002 -4003 -4004 -4005 -4006 -4007 -4008 -4009 -4010 -4011 -4012 -4013 -4014 -4017 -4018 -4019 -4020 -4021 -4022 -4025 -4029 -4030 -4031 -4032 -4034 -4035 -4036 -4037 -4051 -4053 -4054 -4055 -4059 -4060 -4061 -4064 -4065 -4066 -4067 -4068 -4069 -4070 -4072 -4073 -4074 -4075 -4076 -4077 -4078 -4101 -4102 -4103 -4104 -4105 -4106 -4107 -4108 -4109 -4110 -4111 -4112 -4113 -4114 -4115 -4116 -4117 -4118 -4119 -4120 -4121 -4122 -4123 -4124 -4125 -4127 -4128 -4129 -4130 -4131 -4132 -4133 -4151 -4152 -4153 -4154 -4155 -4156 -4157 -4158 -4159 -4160 -4161 -4163 -4164 -4165 -4169 -4170 -4171 -4172 -4173 -4174 -4178 -4179 -4183 -4184 -4205 -4207 -4208 -4209 -4210 -4211 -4212 -4213 -4214 -4215 -4216 -4217 -4218 -4219 -4220 -4221 -4222 -4223 -4224 -4225 -4226 -4227 -4228 -4229 -4230 -4270 -4271 -4272 -4275 -4280 -4285 -4287 -4300 -4301 -4303 -4304 -4305 -4306 -4307 -4309 -4310 -4311 -4312 -4313 -4340 -4341 -4342 -4343 -4344 -4345 -4346 -4347 -4350 -4352 -4353 -4354 -4355 -4356 -4357 -4358 -4359 -4360 -4361 -4362 -4363 -4364 -4365 -4370 -4371 -4372 -4373 -4374 -4375 -4376 -4377 -4378 -4380 -4381 -4382 -4383 -4384 -4385 -4387 -4388 -4390 -4400 -4401 -4402 -4403 -4404 -4405 -4406 -4407 -4408 -4410 -4411 -4412 -4413 -4415 -4416 -4417 -4418 -4419 -4420 -4421 -4422 -4423 -4424 -4425 -4426 -4427 -4428 -4454 -4455 -4461 -4462 -4465 -4467 -4468 -4470 -4471 -4472 -4474 -4475 -4477 -4478 -4479 -4480 -4481 -4482 -4486 -4487 -4488 -4489 -4490 -4491 -4492 -4493 -4494 -4496 -4497 -4498 -4500 -4501 -4502 -4503 -4504 -4505 -4506 -4507 -4508 -4509 -4510 -4511 -4512 -4514 -4515 -4516 -4517 -4518 -4519 -4520 -4521 -4550 -4551 -4552 -4553 -4554 -4555 -4556 -4557 -4558 -4559 -4560 -4561 -4562 -4563 -4564 -4565 -4566 -4567 -4568 -4569 -4570 -4571 -4572 -4573 -4574 -4575 -4580 -4581 -4600 -4601 -4605 -4606 -4608 -4610 -4611 -4612 -4613 -4614 -4615 -4620 -4621 -4625 -4626 -4627 -4630 -4650 -4655 -4659 -4660 -4662 -4670 -4671 -4673 -4674 -4676 -4677 -4678 -4680 -4694 -4695 -4697 -4699 -4700 -4701 -4702 -4703 -4704 -4705 -4706 -4707 -4709 -4710 -4711 -4712 -4713 -4714 -4715 -4716 -4717 -4718 -4719 -4720 -4721 -4722 -4723 -4724 -4725 -4726 -4727 -4728 -4730 -4731 -4732 -4733 -4735 -4736 -4737 -4738 -4739 -4740 -4741 -4742 -4743 -4744 -4745 -4746 -4750 -4751 -4753 -4754 -4756 -4757 -4798 -4799 -4800 -4801 -4802 -4803 -4804 -4805 -4806 -4807 -4808 -4809 -4810 -4811 -4812 -4813 -4814 -4815 -4816 -4817 -4818 -4819 -4820 -4821 -4822 -4823 -4824 -4825 -4828 -4829 -4830 -4849 -4850 -4852 -4854 -4855 -4856 -4857 -4858 -4859 -4860 -4861 -4865 -4868 -4869 -4870 -4871 -4872 -4873 -4874 -4875 -4876 -4877 -4878 -4879 -4880 -4881 -4882 -4883 -4884 -4885 -4886 -4887 -4888 -4890 -4891 -4895 -5000 -5001 -5005 -5006 -5007 -5008 -5009 -5010 -5011 -5012 -5013 -5014 -5015 -5016 -5017 -5018 -5019 -5020 -5021 -5022 -5023 -5024 -5025 -5031 -5032 -5033 -5034 -5035 -5037 -5038 -5039 -5040 -5041 -5042 -5043 -5044 -5045 -5046 -5047 -5048 -5049 -5050 -5051 -5052 -5061 -5062 -5063 -5064 -5065 -5066 -5067 -5068 -5069 -5070 -5071 -5072 -5073 -5074 -5075 -5076 -5081 -5082 -5083 -5084 -5085 -5086 -5087 -5088 -5089 -5090 -5091 -5092 -5093 -5094 -5095 -5096 -5097 -5098 -5106 -5107 -5108 -5109 -5110 -5111 -5112 -5113 -5114 -5115 -5116 -5117 -5118 -5120 -5121 -5125 -5126 -5127 -5131 -5132 -5133 -5134 -5136 -5137 -5138 -5139 -5140 -5141 -5142 -5144 -5150 -5151 -5152 -5153 -5154 -5155 -5156 -5157 -5158 -5159 -5160 -5161 -5162 -5163 -5164 -5165 -5166 -5167 -5168 -5169 -5170 -5171 -5172 -5173 -5174 -5201 -5202 -5203 -5204 -5210 -5211 -5212 -5213 -5214 -5220 -5221 -5222 -5223 -5231 -5232 -5233 -5234 -5235 -5236 -5237 -5238 -5240 -5241 -5242 -5243 -5244 -5245 -5246 -5250 -5251 -5252 -5253 -5254 -5255 -5256 -5259 -5260 -5261 -5262 -5263 -5264 -5265 -5266 -5267 -5268 -5269 -5270 -5271 -5272 -5273 -5275 -5276 -5277 -5278 -5279 -5280 -5290 -5291 -5301 -5302 -5303 -5304 -5306 -5307 -5308 -5309 -5310 -5311 -5312 -5320 -5321 -5322 -5330 -5331 -5332 -5333 -5340 -5341 -5342 -5343 -5344 -5345 -5346 -5350 -5351 -5352 -5353 -5354 -5355 -5356 -5357 -5360 -5371 -5372 -5373 -5374 -5381 -5400 -5401 -5410 -5411 -5412 -5413 -5414 -5415 -5416 -5417 -5418 -5419 -5420 -5421 -5422 -5431 -5432 -5433 -5434 -5440 -5451 -5452 -5453 -5454 -5455 -5460 -5461 -5462 -5464 -5470 -5471 -5472 -5473 -5480 -5481 -5482 -5483 -5485 -5490 -5491 -5493 -5495 -5501 -5502 -5510 -5520 -5521 -5522 -5523 -5540 -5550 -5552 -5554 -5555 -5556 -5558 -5560 -5570 -5571 -5572 -5573 -5575 -5576 -5577 -5580 -5581 -5582 -5583 -5600 -5601 -5602 -5603 -5604 -5605 -5606 -5607 -5608 -5609 -5630 -5631 -5632 -5633 -5640 -5641 -5642 -5650 -5651 -5652 -5653 -5654 -5655 -5660 -5661 -5670 -5671 -5680 -5690 -5700 -5710 -5720 -5722 -5723 -5724 -5725 -5730 -5731 -5732 -5733 -5734 -5800 -5810 -5839 -5860 -5861 -5862 -5863 -5864 -5865 -5866 -5867 -5868 -5869 -5870 -5871 -5872 -5873 -5874 -5875 -5876 -5877 -5878 -5879 -5880 -5881 -5882 -5883 -5884 -5885 -5886 -5887 -5888 -5889 -5890 -5891 -5892 -5893 -5894 -5895 -5896 -5897 -5898 -5899 -5900 -5901 -5902 -5903 -5904 -5920 -5942 -5950 -6000 -6001 -6003 -6004 -6005 -6006 -6007 -6008 -6009 -6010 -6011 -6012 -6014 -6015 -6016 -6017 -6018 -6019 -6020 -6021 -6022 -6023 -6024 -6025 -6026 -6027 -6028 -6029 -6030 -6031 -6032 -6033 -6034 -6035 -6036 -6037 -6038 -6041 -6042 -6043 -6044 -6050 -6051 -6052 -6053 -6054 -6055 -6056 -6057 -6058 -6059 -6060 -6061 -6062 -6063 -6064 -6065 -6066 -6067 -6068 -6069 -6070 -6071 -6072 -6073 -6074 -6076 -6081 -6082 -6083 -6084 -6090 -6100 -6101 -6102 -6103 -6104 -6105 -6106 -6107 -6108 -6109 -6110 -6111 -6112 -6121 -6122 -6123 -6124 -6125 -6126 -6147 -6148 -6149 -6150 -6151 -6152 -6153 -6154 -6155 -6156 -6157 -6158 -6159 -6160 -6161 -6162 -6163 -6164 -6165 -6166 -6167 -6168 -6169 -6170 -6171 -6172 -6173 -6174 -6175 -6176 -6180 -6181 -6182 -6207 -6208 -6209 -6210 -6211 -6213 -6214 -6215 -6218 -6220 -6221 -6223 -6224 -6225 -6226 -6227 -6228 -6229 -6230 -6231 -6232 -6233 -6236 -6237 -6239 -6240 -6243 -6244 -6251 -6252 -6253 -6254 -6255 -6256 -6258 -6260 -6262 -6271 -6275 -6280 -6281 -6282 -6284 -6285 -6286 -6288 -6290 -6302 -6304 -6306 -6308 -6309 -6311 -6312 -6313 -6315 -6316 -6317 -6318 -6320 -6321 -6322 -6323 -6324 -6326 -6327 -6328 -6330 -6331 -6332 -6333 -6335 -6336 -6337 -6338 -6341 -6343 -6346 -6348 -6350 -6351 -6352 -6353 -6355 -6356 -6357 -6358 -6359 -6361 -6363 -6365 -6367 -6368 -6369 -6370 -6372 -6373 -6375 -6383 -6384 -6385 -6386 -6390 -6391 -6392 -6393 -6394 -6395 -6396 -6397 -6398 -6401 -6403 -6405 -6407 -6409 -6410 -6411 -6412 -6413 -6414 -6415 -6418 -6419 -6420 -6421 -6422 -6423 -6424 -6425 -6426 -6427 -6428 -6429 -6430 -6431 -6432 -6433 -6434 -6436 -6437 -6438 -6440 -6442 -6443 -6445 -6446 -6447 -6448 -6450 -6452 -6460 -6461 -6462 -6463 -6465 -6466 -6467 -6468 -6470 -6472 -6473 -6475 -6476 -6477 -6479 -6480 -6484 -6485 -6487 -6488 -6489 -6490 -6501 -6502 -6503 -6504 -6505 -6506 -6507 -6509 -6510 -6511 -6512 -6513 -6514 -6515 -6516 -6517 -6518 -6519 -6521 -6522 -6525 -6528 -6530 -6531 -6532 -6535 -6536 -6537 -6556 -6558 -6560 -6562 -6564 -6566 -6567 -6568 -6569 -6571 -6572 -6574 -6575 -6603 -6605 -6606 -6608 -6609 -6612 -6613 -6614 -6616 -6620 -6623 -6625 -6627 -6628 -6630 -6631 -6632 -6635 -6638 -6639 -6640 -6642 -6646 -6701 -6705 -6707 -6710 -6711 -6712 -6713 -6714 -6716 -6718 -6720 -6721 -6722 -6725 -6726 -6728 -6731 -6733 -6740 -6743 -6751 -6753 -6754 -6758 -6760 -6762 -6765 -6770 -6798 -6799 -6800 -6803 -6809 -6817 -6820 -6827 -6830 -6831 -6832 -6837 -6838 -6839 -6840 -6841 -6842 -6843 -6844 -6845 -6846 -6847 -6848 -6849 -6850 -6865 -6872 -6892 -6900 -6901 -6902 -6903 -6904 -6905 -6906 -6907 -6909 -6910 -6911 -6912 -6913 -6914 -6915 -6916 -6917 -6918 -6919 -6920 -6921 -6922 -6923 -6924 -6925 -6926 -6929 -6931 -6932 -6933 -6934 -6935 -6936 -6937 -6938 -6939 -6940 -6941 -6942 -6943 -6944 -6945 -6946 -6947 -6951 -6952 -6953 -6954 -6955 -6956 -6957 -6958 -6959 -6960 -6961 -6963 -6964 -6965 -6966 -6967 -6968 -6969 -6970 -6979 -6980 -6981 -6982 -6983 -6984 -6985 -6986 -6987 -6988 -6989 -6990 -6991 -6992 -6997 -7000 -7001 -7002 -7004 -7005 -7006 -7007 -7008 -7009 -7010 -7011 -7012 -7015 -7016 -7017 -7018 -7019 -7020 -7021 -7022 -7023 -7024 -7025 -7026 -7027 -7030 -7050 -7051 -7052 -7053 -7054 -7055 -7109 -7112 -7113 -7116 -7117 -7119 -7120 -7139 -7140 -7150 -7151 -7155 -7162 -7163 -7170 -7171 -7172 -7173 -7174 -7175 -7176 -7177 -7178 -7179 -7180 -7182 -7183 -7184 -7185 -7186 -7187 -7190 -7209 -7210 -7211 -7212 -7213 -7214 -7215 -7216 -7248 -7249 -7250 -7252 -7253 -7254 -7255 -7256 -7257 -7258 -7259 -7260 -7261 -7262 -7263 -7264 -7265 -7267 -7268 -7270 -7275 -7276 -7277 -7290 -7291 -7292 -7300 -7301 -7302 -7303 -7304 -7305 -7306 -7307 -7310 -7315 -7316 -7320 -7321 -7322 -7325 -7330 -7331 -7466 -7467 -7468 -7469 -7470 -7800 -7802 -7803 -7804 -7805 -7806 -7807 -7808 -7809 -7810 -7811 -7812 -7813 -7814 -7823 -7824 -7827 -7828 -7829 -7845 -7850 -7901 -7902 -7903 -7904 -7905 -7906 -7907 -7908 -7909 -7910 -7911 -7912 -7913 -7914 -7915 -7916 -7917 -7918 -7919 -7920 -7921 -7922 -7923 -8001 -8002 -8003 -8004 -8005 -8006 -8007 -8008 -8009 -8010 -8011 -8012 -8045 -8051 -8060 -8061 -8066 -8069 -8070 -8071 -8102 -8103 -8107 -8108 -8111 -8120 -8205 -8383 -8386 -8388 -8390 -8393 -8394 -8396 -8399 -8500 -8507 -8538 -8557 -8576 -8622 -8626 -8627 -8785 -8865 -8873 -9000 -9001 -9002 -9005 -9007 -9008 -9009 -9010 -9013 -9015 -9016 -9017 -9018 -9019 -9020 -9021 -9022 -9023 -9464 -9726 -9728 -9729 \ No newline at end of file diff --git a/docs/validate_au_fetch_postcodes.php b/docs/validate_au_fetch_postcodes.php deleted file mode 100644 index 161c6a9..0000000 --- a/docs/validate_au_fetch_postcodes.php +++ /dev/null @@ -1,104 +0,0 @@ - - * @copyright 2008 Dave Hall - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id$ - * @link http://pear.php.net/package/Validate_AU - */ - -function main() { - - // Download - $source = file_get_contents('http://www1.auspost.com.au/download/pc-full.zip'); - - if (!is_writable(dirname(__FILE__))) { - die("I can't write to " . dirname(__FILE__)); - } - - $path = dirname(__FILE__) . '/pc-full.zip'; - if (!file_put_contents($path, $source)) { - die("Failed to write archive to " . $path); - } - - $fp = fopen($path, 'r'); - - if (!$fp) { - die("Couldn't read " . $path); - } - - //Extract - $zip = new ZipArchive; - if (!$zip->open($path)) { - die("Couldn't read zip " . $path); - } - - $postcode_path = dirname(__FILE__) . '/postcodes'; - $zip->extractTo($postcode_path); - $zip->close(); - - $dir = new DirectoryIterator($postcode_path); - - foreach ($dir as $file) { - if (!is_file($file)) { - continue; - } - - $postcodes = fetch_postcodes_from_file(fopen((string)$file, 'r')); - - - sort($postcodes, SORT_NUMERIC); -var_dump($postcodes); - print implode("\n", $postcodes); - - //unlink($postcode_path . '/' . (string)$file); - } -} - -/** - * Read a file pointer and preg match it for valid - * postcodes - * - * @param resource $fp File to read - * - * return string[] - */ -function fetch_postcodes_from_file($fp) { - - $postcodes = array(); - while ($data = fgetcsv($fp)) { - $line = fgets($fp, 1024); - - $m = array(); - preg_match('/^"([\d]{4})"/', $line, $m); - if (count($m)) { - $postcodes[] = $m[1]; - } - } - - return array_unique($postcodes); -} - - -main(); -?> - diff --git a/package_AU.xml b/package_AU.xml deleted file mode 100644 index 03e9fa3..0000000 --- a/package_AU.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - Validate_AU - pear.php.net - Data validation class for Australia. - Package containes locale validation for AU such as: - * Phone Number - * Postal Code - * Tax File Number - * Australian Business Number - * Australian Company Number - * Australian Regional Codes - - Alex Hayes - ahayes - ahayes@wcg.net.au - no - - - Byron Adams - badams - byron.adams54@gmail.com - no - - - Daniel O'Connor - doconnor - daniel.oconnor@gmail.com - yes - - 2008-12-30 - - - 0.1.4 - 0.1.1 - - - alpha - alpha - - BSD License - Bug #15454 - Updated postcode listings. - - - - - - - - - - - - - - - - 4.2.0 - 6.0.0 - - - 1.4.9 - - - Validate - pear.php.net - 0.5.0 - 0.5.0 - - - - - - - - 0.1.2 - 0.1.1 - - - alpha - alpha - - 2008-10-27 - BSD License - Bug #14320 - Strict validation now expects '0800' as a valid post code. - - - - 0.1.1 - 0.1.1 - - - alpha - alpha - - 2008-04-22 - BSD License - - Bug #13111 phoneNumber() tests inaccurate (changes API) - - - - 0.1.0 - 0.1.0 - - - alpha - alpha - - 2006-10-10 - BSD License - - Added support for 13,13xx,18xx,19xx and international syntax phone numbers -- Change package.xml to version 2 - - - diff --git a/tests/validate_AU.phpt b/tests/validate_AU.phpt deleted file mode 100644 index c45f409..0000000 --- a/tests/validate_AU.phpt +++ /dev/null @@ -1,308 +0,0 @@ ---TEST-- -validate_AU.phpt: Unit tests for 'Validate/AU.php' ---FILE-- - 'KO'); -$phones['nationalPhones'] = array('0883690791' => 'OK'); -$phones['indialPhones'] = array('1302123456' => 'KO', - '1300123456' => 'OK', - '131234' => 'OK'); -$phones['premiumSMS'] = array('191234' => 'OK', - '1912345' => 'OK', - '19123467' => 'OK'); - -//International service - prefix 001 or 009 - 1 number - -//Digital mobile service - prefix 04 - 100,000 numbers -$phones['mobilePhones'] = array('0413567532' => 'OK'); - - -//Universal personal telecommunications service -$phones['universalPersonalPhones'] = array('0500456789' => 'OK', - '0550456789' => 'OK', - '0590456789' => 'OK'); - - -//Data network access -//prefix 019 80, 019 81, 019 82 or 019 83 -$phones['data'] = array('0198304123' => 'OK', - '0198204123' => 'OK', - '0198104123' => 'OK', - '0198004123' => 'OK', - '0198404123' => 'KO'); - -$postalCodes = array( 5251 => 'OK', - 5000 => 'OK', - 4662 => 'OK', - 2470 => 'OK', - 1000 => 'OK', // (OK if not strong) - 9999 => 'OK', // (OK if not strong) - 'abc' => 'KO', - '800' => 'KO', - '0800' => 'OK', - 'a7000' => 'KO'); - -$postalCodesStrong = array( 5251 => 'OK', - 5000 => 'OK', - 4662 => 'OK', - 2470 => 'OK', - 1000 => 'KO', // (OK if not strong) - 9999 => 'KO', // (OK if not strong) - '800' => 'KO', - '0800' => 'OK', - 'abc' => 'KO', - 'a7000' => 'KO', -); - -$abns = array( -'28 043 145 470' => 'OK', -'65 497 794 289' => 'OK', -'46 527 394 509' => 'OK', -'99 070 045 359' => 'OK', -'98 860 905 153' => 'OK', -'53 106 288 699' => 'OK', -'51 008 129 511' => 'OK', -'43 500 713 236' => 'OK', -'72 342 387 170' => 'OK', -'21 188 299 895' => 'OK', -'55 914 901 347' => 'OK', -'92 638 328 368' => 'OK', - );//OK - - -$tfns = array( -'123 456 782' => 'OK', - );//OK - -$acns = array( -'000 000 019' => 'OK', -'000 250 000' => 'OK', -'000 500 005' => 'OK', -'000 750 005' => 'OK', -'001 000 004' => 'OK', -'001 250 004' => 'OK', -'001 500 009' => 'OK', -'001 749 999' => 'OK', -'001 999 999' => 'OK', -'002 249 998' => 'OK', -'002 499 998' => 'OK', -'002 749 993' => 'OK', -'002 999 993' => 'OK', -'003 249 992' => 'OK', -'003 499 992' => 'OK', -'003 749 988' => 'OK', -'003 999 988' => 'OK', -'004 249 987' => 'OK', -'004 499 987' => 'OK', -'004 749 982' => 'OK', -'004 999 982' => 'OK', -'005 249 981' => 'OK', -'005 499 981' => 'OK', -'005 749 986' => 'OK', -'005 999 977' => 'OK', -'006 249 976' => 'OK', -'006 499 976' => 'OK', -'006 749 980' => 'OK', -'006 999 980' => 'OK', -'007 249 989' => 'OK', -'007 499 989' => 'OK', -'007 749 975' => 'OK', -'007 999 975' => 'OK', -'008 249 974' => 'OK', -'008 499 974' => 'OK', -'008 749 979' => 'OK', -'008 999 979' => 'OK', -'009 249 969' => 'OK', -'009 499 969' => 'OK', -'009 749 964' => 'OK', -'009 999 964' => 'OK', -'010 249 966' => 'OK', -'010 499 966' => 'OK', -'010 749 961' => 'OK', -);//OK - -$errorFound = false; - -foreach ($phones as $data) { - $errorFound = $errorFound || test_func(array('validate_AU','phoneNumber'), $data); -} - -$errorFound = $errorFound || test_func(array('validate_AU','postalCode'), $postalCodes, array(false, $dataDir)); -$errorFound = $errorFound || test_func(array('validate_AU','postalCode'), $postalCodesStrong, array(true, $dataDir)); -$errorFound = $errorFound || test_func(array('validate_AU','abn'), $abns); -$errorFound = $errorFound || test_func(array('validate_AU','acn'), $acns); -$errorFound = $errorFound || test_func(array('validate_AU','tfn'), $tfns); - - -?> ---EXPECT-- -Test Validate_AU -**************** ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 0212345678 : KO KO ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 0883690791 : OK OK ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 1302123456 : KO KO - V 1300123456 : OK OK - V 131234 : OK OK ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 191234 : OK OK - V 1912345 : OK OK - V 19123467 : OK OK ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 0413567532 : OK OK ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 0500456789 : OK OK - V 0550456789 : OK OK - V 0590456789 : OK OK ---------- -Test validate_AU::phoneNumber - _ Value State Return - V = validation result is right - X = validation result is wrong - V 0198304123 : OK OK - V 0198204123 : OK OK - V 0198104123 : OK OK - V 0198004123 : OK OK - V 0198404123 : KO KO ---------- -Test validate_AU::postalCode - _ Value State Return - V = validation result is right - X = validation result is wrong - V 5251 : OK OK - V 5000 : OK OK - V 4662 : OK OK - V 2470 : OK OK - V 1000 : OK OK - V 9999 : OK OK - V abc : KO KO - V 800 : KO KO - V 0800 : OK OK - V a7000 : KO KO ---------- -Test validate_AU::postalCode - _ Value State Return - V = validation result is right - X = validation result is wrong - V 5251 : OK OK - V 5000 : OK OK - V 4662 : OK OK - V 2470 : OK OK - V 1000 : KO KO - V 9999 : KO KO - V 800 : KO KO - V 0800 : OK OK - V abc : KO KO - V a7000 : KO KO ---------- -Test validate_AU::abn - _ Value State Return - V = validation result is right - X = validation result is wrong - V 28 043 145 470 : OK OK - V 65 497 794 289 : OK OK - V 46 527 394 509 : OK OK - V 99 070 045 359 : OK OK - V 98 860 905 153 : OK OK - V 53 106 288 699 : OK OK - V 51 008 129 511 : OK OK - V 43 500 713 236 : OK OK - V 72 342 387 170 : OK OK - V 21 188 299 895 : OK OK - V 55 914 901 347 : OK OK - V 92 638 328 368 : OK OK ---------- -Test validate_AU::acn - _ Value State Return - V = validation result is right - X = validation result is wrong - V 000 000 019 : OK OK - V 000 250 000 : OK OK - V 000 500 005 : OK OK - V 000 750 005 : OK OK - V 001 000 004 : OK OK - V 001 250 004 : OK OK - V 001 500 009 : OK OK - V 001 749 999 : OK OK - V 001 999 999 : OK OK - V 002 249 998 : OK OK - V 002 499 998 : OK OK - V 002 749 993 : OK OK - V 002 999 993 : OK OK - V 003 249 992 : OK OK - V 003 499 992 : OK OK - V 003 749 988 : OK OK - V 003 999 988 : OK OK - V 004 249 987 : OK OK - V 004 499 987 : OK OK - V 004 749 982 : OK OK - V 004 999 982 : OK OK - V 005 249 981 : OK OK - V 005 499 981 : OK OK - V 005 749 986 : OK OK - V 005 999 977 : OK OK - V 006 249 976 : OK OK - V 006 499 976 : OK OK - V 006 749 980 : OK OK - V 006 999 980 : OK OK - V 007 249 989 : OK OK - V 007 499 989 : OK OK - V 007 749 975 : OK OK - V 007 999 975 : OK OK - V 008 249 974 : OK OK - V 008 499 974 : OK OK - V 008 749 979 : OK OK - V 008 999 979 : OK OK - V 009 249 969 : OK OK - V 009 499 969 : OK OK - V 009 749 964 : OK OK - V 009 999 964 : OK OK - V 010 249 966 : OK OK - V 010 499 966 : OK OK - V 010 749 961 : OK OK ---------- -Test validate_AU::tfn - _ Value State Return - V = validation result is right - X = validation result is wrong - V 123 456 782 : OK OK