Skip to content
Browse files

Remove Validate_DE

  • Loading branch information...
1 parent 1f28f3d commit f106dcb11de6136c9fe0e6551e344bc3b99dc69d @CloCkWeRX CloCkWeRX committed
Showing with 0 additions and 129 deletions.
  1. +0 −73 Validate/DE.php
  2. +0 −56 tests/validate_DE.phpt
View
73 Validate/DE.php
@@ -1,73 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4: */
-/**
- * Methods for common German data validations
- *
- * PHP Versions 4 and 5
- *
- * This source file is subject to the New BSD license, That is bundled
- * with this package in the file LICENSE, and is available through
- * the world-wide-web at
- * http://www.opensource.org/licenses/bsd-license.php
- * If you did not receive a copy of the new BSDlicense and are unable
- * to obtain it through the world-wide-web, please send a note to
- * pajoye@php.net so we can mail you a copy immediately.
- *
- * @category Validate
- * @package Validate_DE
- * @author Stefan Neufeind <pear.neufeind@speedpartner.de>
- * @copyright 1997-2005 Stefan Neufeind
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Validate_DE
- */
-
-/**
- * Data validation class for Germany
- *
- * This class provides methods to validate:
- * - Postal code
- * - German bank code
- *
- * @category Validate
- * @package Validate_DE
- * @author Stefan Neufeind <pear.neufeind@speedpartner.de>
- * @copyright 1997-2005 Stefan Neufeind
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Validate_DE
- */
-class Validate_DE
-{
- /**
- * Validate a German postcode
- *
- * @param string $postcode postcode to validate
- * @param bool $strong optional; strong checks (e.g. against a list of
- * postcodes) (not implemented)
- *
- * @return bool true if postcode is ok, false otherwise
- */
- function postalCode($postcode, $strong = false)
- {
- // $strong is not used here at the moment; added for API compatibility
- // checks might be added at a later stage
-
- return (bool)preg_match('/^[0-9]{5}$/', $postcode);
- }
-
- /**
- * Validate a German bankcode
- *
- * German bankcodes consist of exactly 8 numbers
- *
- * @param string $bankcode German bankcode to validate
- *
- * @return bool true if bankcode is ok, false otherwise
- */
- function bankcode($bankcode)
- {
- return (bool)preg_match('/^[0-9]{8}$/', $bankcode);
- }
-}
-?>
View
56 tests/validate_DE.phpt
@@ -1,56 +0,0 @@
---TEST--
-validate_DE.phpt: Unit tests for 'Validate/DE.php'
---FILE--
-<?php
-// $Id$
-
-// Validate test script
-$noYes = array('NO', 'YES');
-require_once 'Validate/DE.php';
-
-echo "Test Validate_DE\n";
-echo "****************\n";
-
-$postalCodes = array( '10115', // OK
- '09111', // OK
- '80331', // OK
- '0115', // NOK
- '101154', // NOK
- 'x1154' // NOK
-);
-
-$bankcodes = array( '59050101', // OK
- '60250010', // OK
- '70051805', // OK
- '7005180S', // NOK
- '7005180', // NOK
- '700518073' // NOK
-);
-
-echo "Test postalCode\n";
-foreach ($postalCodes as $postalCode) {
- echo "{$postalCode}: ".$noYes[Validate_DE::postalCode($postalCode)]."\n";
-}
-
-echo "Test bankcode\n";
-foreach ($bankcodes as $bankcode) {
- echo "{$bankcode}: ".$noYes[Validate_DE::bankcode($bankcode)]."\n";
-}
-?>
---EXPECT--
-Test Validate_DE
-****************
-Test postalCode
-10115: YES
-09111: YES
-80331: YES
-0115: NO
-101154: NO
-x1154: NO
-Test bankcode
-59050101: YES
-60250010: YES
-70051805: YES
-7005180S: NO
-7005180: NO
-700518073: NO

0 comments on commit f106dcb

Please sign in to comment.
Something went wrong with that request. Please try again.