From 7304f4ad080b01ecff407f131d8516ac12c5bbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Clemens=20Wei=C3=9F?= Date: Tue, 9 Oct 2018 18:31:38 +0200 Subject: [PATCH] Updated validator 45 (changed on June 4th 2018) --- classes/validator/validators/Validator45.php | 1 + tests/unit/validators/Validator45Test.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/classes/validator/validators/Validator45.php b/classes/validator/validators/Validator45.php index faf778aa..838a5303 100644 --- a/classes/validator/validators/Validator45.php +++ b/classes/validator/validators/Validator45.php @@ -38,6 +38,7 @@ protected function getResult() { return $this->account{0} === '0' || $this->account{4} === '1' + || substr($this->account, 0, 2) === '48' || parent::getResult(); } } diff --git a/tests/unit/validators/Validator45Test.php b/tests/unit/validators/Validator45Test.php index 4ccb6fa8..3604c851 100644 --- a/tests/unit/validators/Validator45Test.php +++ b/tests/unit/validators/Validator45Test.php @@ -49,6 +49,9 @@ public function provideTestData() ['1000199999', true], ['0100114240', true], + // no check sum because account number starts with 48 + ['4890001112', true], + ['3545343233', false], ['4013410025', false], @@ -59,6 +62,9 @@ public function provideTestData() // no check sum available because 5th position equals 1 (one) - negation ['1000299999', false], ['1100214240', false], + + // no check sum because account number starts with 48 - negation + ['5890001112', false], ]; } }