Permalink
Browse files

Shift to own package

  • Loading branch information...
1 parent 61c5b3b commit ce601c54423c1d68e3dfa4f648db82e3782853a7 @CloCkWeRX CloCkWeRX committed Dec 26, 2011
View
View
View
@@ -1,73 +0,0 @@
-*Validate_BE*
-
-This package was begin on May 2005
-Christophe Gesch� // moosh@claroline.net
-With help of coders of other Validate_FOO packages
-
-
- * -Done- Post Code
- * -Done- Bank Account Number
- * -Done- Transfer message (transfer from an bank account to another)
- * -Done- VAT
- * -Done- Natitonal ID
- * -Todo- Identity Card Number
- * -Done- SIS CARD ID (belgian "s�curit� sociale" ID)
-
------Post Code
-Belgian post code are build as 4-figure number, with optionaly a B- to mark the country in the post code
-The first number is the region.
-
------Bank Account Number
-123-1234567-84
-or
-123123456784
-
-123 is the bankcode
-1234567 is the account number in this bank
-84 is the MOD97 of 1231234567
-
-Validation accept account number with or without -
-But if present, they need to be between the 3th and 4th number
-and 10th and 11th number.
-
-TODO : The validation check if the bank exist
-
------Transfer message (transfer from an bank account to another)
-In Belgium, an transfer from your account to another.
-On a transfert you can add a message
-There is two types of messages
-
- * ordinary text
- * structured
-
-----------Ordinary text
- 2 lines of 53 caracters
- !#$%'()*+,-./0123456789:;<=>?@
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-[]^_`
-abcdefghijklmnopqrstuvwxyz
-{|}�����������������������"
-----------Bank Message Transfert
-
-The structured message is build by the benificary.
-Have the form 123/1234/12345;
-2 last are mod 97
-
------VAT
-VAT number in Belgium is 9-figure number
-checksum is 97-valMOD97
-
-European system request 10-figure number
-
------National ID
-National ID is the number given to each people in belgian registry.
-It's the reversed birth date, (6-figure number)
-and unique ID for this date (3-figure number)
-Mod97 (2-figure number)
-730111361-73
-
------Identity Card Number
-Obligatory to have an identicard from 12 year old.
-The Identity Card Number as bank account number.
-10-figure number + 2 for 97 - MOD97
-SIS CARD ID (belgian "s�curit� sociale" ID)
View
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.7.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>Validate_BE</name>
- <channel>pear.php.net</channel>
- <summary>Validation class for Belgium</summary>
- <description>Package containes locale validation for Belgium such as:
- * Postal Code
- * Bank Account Number
- * Structured Bank Transfer message
- (Nationnal transfer from an bank account to another)
- * VAT
- * Natitonal ID
- * Identity Card Number (not ready)
- * SIS CARD ID (belgian &quot;sécurité sociale&quot; ID)</description>
- <lead>
- <name>Christophe Gesché</name>
- <user>moosh</user>
- <email>moosh@claroline.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>bertrand Gugger</name>
- <user>toggg</user>
- <email>toggg@php.net</email>
- <active>no</active>
- </lead>
- <helper>
- <name>Frederic Minne</name>
- <user>zefredz</user>
- <email>zefredz@php.net</email>
- <active>yes</active>
- </helper>
- <date>2009-03-23</date>
- <time>01:29:43</time>
- <version>
- <release>0.1.4</release>
- <api>0.1.3</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
- <notes>Updated to package 2.0
-QA release
-Bug #11835 - no longer using validate_be_functions.inc.php
-Bug #11836 - PHPCS
-Bug #11868 - Unit tests don&apos;t run from CVS
-Bug #15167 - Unit test failures</notes>
- <contents>
- <dir baseinstalldir="/" name="/">
- <file baseinstalldir="/" md5sum="134dd9c8a39906ad67df8d0a4917d7f1" name="data/BE_postcodes.txt" role="data" />
- <file baseinstalldir="/" md5sum="a56abbaebf5e09e005cc251fb451cb05" name="docs/Validate_BE.txt" role="doc" />
- <file baseinstalldir="/" name="tests/validate_BE_bank_codes.phpt" role="test" />
- <file baseinstalldir="/" md5sum="db86c3a71e3ac2ad3e4c280fc523ca2a" name="tests/validate_BE_bank_transfer_message.phpt" role="test" />
- <file baseinstalldir="/" md5sum="b2d5ac7685a6f1f65d6430b2dd63561f" name="tests/validate_BE_national_id.phpt" role="test" />
- <file baseinstalldir="/" md5sum="fe286b02735540bdeceff5be9dff52cc" name="tests/validate_BE_phone_numbers.phpt" role="test" />
- <file baseinstalldir="/" md5sum="991e1c9171d44a076d034b74791ae46b" name="tests/validate_BE_post_code.phpt" role="test" />
- <file baseinstalldir="/" md5sum="52d630f07e11bbc14989fbb570971671" name="tests/validate_BE_post_code_strong.phpt" role="test" />
- <file baseinstalldir="/" md5sum="eb2a1b346e1659d0d9e053f7db73d1b3" name="tests/validate_BE_ssn.phpt" role="test" />
- <file baseinstalldir="/" md5sum="fe8a7399126875b768dfa9a5f6f33b54" name="tests/validate_BE_vat.phpt" role="test" />
- <file baseinstalldir="/" md5sum="85d9bddf0d6638c860d82cd4dbfffc0c" name="tests/validate_functions.inc" role="test" />
- <file baseinstalldir="/" md5sum="22c8b84343f33c64a644bd251691a0be" name="Validate/BE.php" role="php">
- <tasks:replace from="@DATADIR@" to="data_dir" type="pear-config" />
- </file>
- <file baseinstalldir="/" md5sum="7073f9a84fa6da71e7a505a777dda302" name="LICENSE" role="doc" />
- <file baseinstalldir="/" md5sum="3a8d37a072f418308635d61c853fe1f6" name="package_BE.xml" role="data" />
- </dir>
- </contents>
- <dependencies>
- <required>
- <php>
- <min>4.4.9</min>
- </php>
- <pearinstaller>
- <min>1.6.0</min>
- </pearinstaller>
- <package>
- <name>Validate</name>
- <channel>pear.php.net</channel>
- <min>0.5.0</min>
- </package>
- </required>
- </dependencies>
- <phprelease>
- <filelist>
- <install as="BE_postcodes.txt" name="data/BE_postcodes.txt" />
- </filelist>
- </phprelease>
- <changelog>
- <release>
- <version>
- <release>0.1.0</release>
- <api>0.1.0</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2005-01-30</date>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
- <notes>* first release 0.1.0
- -Done- Post Code
- -Done- Bank Account Number
- -Todo- Transfer message (transfer from an bank account to another)
- -Done- VAT
- -Done- Natitonal ID
- -Todo- Identity Card Number
- -Done- SIS CARD ID (belgian &quot;sécurité sociale&quot; ID)</notes>
- </release>
- <release>
- <version>
- <release>0.1.1</release>
- <api>0.1.1</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2005-09-30</date>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
- <notes>* Add new method to validate structured Bank Transfert Messages
-* Add new method to validate nationalId
-* Fixed CS
-* Fixed check phone was bug for mobil begining with 04
-* split test files on per method
-* toggg and moosh now co-leads</notes>
- </release>
- <release>
- <version>
- <release>0.1.2</release>
- <api>0.1.2</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2005-11-04</date>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
- <notes>- Switch to the new BSD License
-(see http://www.opensource.org/licenses/bsd-license.php)</notes>
- </release>
- <release>
- <version>
- <release>0.1.4</release>
- <api>0.1.3</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2009-03-23</date>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license>
- <notes>Updated to package 2.0
-QA release
-Bug #11835 - no longer using validate_be_functions.inc.php
-Bug #11836 - PHPCS
-Bug #11868 - Unit tests don&apos;t run from CVS
-Bug #15167 - Unit test failures</notes>
- </release>
- </changelog>
-</package>
@@ -1,58 +0,0 @@
---TEST--
-validate_BE_bank_codes.phpt: Unit tests for bank code method 'Validate/BE.php'
---FILE--
-<?php
-include (dirname(__FILE__).'/validate_functions.inc');
-if (is_file(dirname(__FILE__) . '/../Validate/BE.php')) {
- require_once dirname(__FILE__) . '/../Validate/BE.php';
- $dataDir = dirname(__FILE__) . '/../data';
-} else {
- require_once 'Validate/BE.php';
- $dataDir = null;
-}
-
-echo "Test bank code Validate_BE\n";
-echo "**************************\n";
-
-
-$bankCodeList = array( '310164533207' => 'OK'
-, '310164533227' => 'KO'
-, '31c164533207' => 'KO'
-, '096011784309' => 'OK'
-, '310-164533207' => 'OK'
-, '310-164533227' => 'KO'
-, '310-1645332-07' => 'OK'
-, '310-1645332-27' => 'KO'
-, '310.1645332.07' => 'OK'
-, '310.1645332.27' => 'KO'
-, '310 1645332 07' => 'OK'
-, '310 1645332 27' => 'KO'
-,
-);
-
-$errorFound = false;
-$errorFound = $errorFound || test_func(array('validate_BE','bankCode'), $bankCodeList );
-echo ($errorFound) ? '... FAILED' : '... SUCCESS';
-
-?>
---EXPECT--
-Test bank code Validate_BE
-**************************
----------
-Test validate_BE::bankCode
- _ Value State Return
- V = validation result is right
- X = validation result is wrong
- V 310164533207 : OK OK
- V 310164533227 : KO KO
- V 31c164533207 : KO KO
- V 096011784309 : OK OK
- V 310-164533207 : OK OK
- V 310-164533227 : KO KO
- V 310-1645332-07 : OK OK
- V 310-1645332-27 : KO KO
- V 310.1645332.07 : OK OK
- V 310.1645332.27 : KO KO
- V 310 1645332 07 : OK OK
- V 310 1645332 27 : KO KO
-... SUCCESS
@@ -1,53 +0,0 @@
---TEST--
-validate_BE_bank_transfer_message.phpt: Unit tests for bank transfert message method 'Validate/BE.php'
---FILE--
-<?php
-include (dirname(__FILE__).'/validate_functions.inc');
-if (is_file(dirname(__FILE__) . '/../Validate/BE.php')) {
- require_once dirname(__FILE__) . '/../Validate/BE.php';
- $dataDir = dirname(__FILE__) . '/../data';
-} else {
- require_once 'Validate/BE.php';
- $dataDir = null;
-}
-
-echo "Test bank Transfer Message Validate_BE\n";
-echo "**************************************\n";
-
-
-$bankTransferMessageList = array( '054/3140/16211' => 'OK'
- , '053/3140/16211' => 'KO'
- , '054.3140.16211' => 'OK'
- , '053.3140.16211' => 'KO'
- , '054-3140-16211' => 'OK'
- , '053-3140-16211' => 'KO'
- , '054 3140 16211' => 'OK'
- , '053 3140 16211' => 'KO'
- , '054314016211' => 'OK'
- , '053314016211' => 'KO'
- , '54314016211' => 'KO'
- );
-$errorFound = false;
-$errorFound = $errorFound || test_func(array('validate_BE','bankTransferMessage'), $bankTransferMessageList );
-echo ($errorFound) ? '... FAILED' : '... SUCCESS';
-?>
---EXPECT--
-Test bank Transfer Message Validate_BE
-**************************************
----------
-Test validate_BE::bankTransferMessage
- _ Value State Return
- V = validation result is right
- X = validation result is wrong
- V 054/3140/16211 : OK OK
- V 053/3140/16211 : KO KO
- V 054.3140.16211 : OK OK
- V 053.3140.16211 : KO KO
- V 054-3140-16211 : OK OK
- V 053-3140-16211 : KO KO
- V 054 3140 16211 : OK OK
- V 053 3140 16211 : KO KO
- V 054314016211 : OK OK
- V 053314016211 : KO KO
- V 54314016211 : KO KO
-... SUCCESS
@@ -1,33 +0,0 @@
-<?php
-
-function test_func($func_name, $data ,$scndParam=NULL)
-{
- global $noYes;
- $noYes = array('KO', 'OK');
-
- echo "---------\nTest " . $func_name . "\n";
- echo ' _ Value State Return' . "\n";
- echo ' V = validation result is right' . "\n";
- echo ' X = validation result is wrong' . "\n";
-
- foreach ($data as $value => $resultWaited) {
-
- if(!is_null($scndParam))
- {
- $result = $noYes[Validate_BE::$func_name($value,$scndParam)];
- }
- else
-
- $result = $noYes[Validate_BE::$func_name($value)];
-
- echo ($resultWaited == $result
- ? ' V '
- : '!X!')
- .str_pad($value, 20) . " : ".$resultWaited . ' ' . $result ."\n";
-
- }
- return ($resultWaited != $result );
-
-}
-
-?>
Oops, something went wrong. Retry.

0 comments on commit ce601c5

Please sign in to comment.