Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
validate_DE.phpt: Unit tests for 'Validate/DE.php'
3
--FILE--
4
<?php
5
// $Id: validate_DE.phpt 185239 2005-04-27 04:54:56Z toggg $
6
 
7
// Validate test script
8
$noYes = array('NO', 'YES');
9
require_once 'Validate/DE.php';
10
 
11
echo "Test Validate_DE\n";
12
echo "****************\n";
13
 
14
$postalCodes = array( '10115', // OK
15
                      '09111', // OK
16
                      '80331', // OK
17
                     '0115', // NOK
18
                     '101154', // NOK
19
                     'x1154' // NOK
20
);
21
 
22
$bankcodes = array( '59050101', // OK
23
                      '60250010', // OK
24
                      '70051805', // OK
25
                      '7005180S', // NOK
26
                      '7005180', // NOK
27
                      '700518073' // NOK
28
);
29
 
30
echo "Test postalCode\n";
31
foreach ($postalCodes as $postalCode) {
32
    echo "{$postalCode}: ".$noYes[Validate_DE::postalCode($postalCode)]."\n";
33
}
34
 
35
echo "Test bankcode\n";
36
foreach ($bankcodes as $bankcode) {
37
    echo "{$bankcode}: ".$noYes[Validate_DE::bankcode($bankcode)]."\n";
38
}
39
?>
40
--EXPECT--
41
Test Validate_DE
42
****************
43
Test postalCode
44
10115: YES
45
09111: YES
46
80331: YES
47
0115: NO
48
101154: NO
49
x1154: NO
50
Test bankcode
51
59050101: YES
52
60250010: YES
53
70051805: YES
54
7005180S: NO
55
7005180: NO
56
700518073: NO