diff --git a/README.md b/README.md index 0f1c6c70..7e2fd250 100644 --- a/README.md +++ b/README.md @@ -61,16 +61,16 @@ You can also access the localized validators any time you would call `Validation } ``` -## Po files +## PO files -This plugin also houses translations for the client-facing translated strings in the core (the cake domain). to use these files link or copy them -into their expected location: `APP/locale//LC_MESSAGES/cake.po` +This plugin also houses translations for the client-facing translated strings in the core (the `cake` domain). to use these files link or copy them +into their expected location: `APP/Locale//LC_MESSAGES/cake.po` ## LC_TIME files This plugin also houses POSIX compliant LC_TIME files which are used for translating time related string of LC_TIME domain. To use these files link or copy them into -their expected location: `APP/locale//LC_TIME`. +their expected location: `APP/Locale//LC_TIME`. ## Migration Guide diff --git a/Test/Case/Validation/HrValidationTest.php b/Test/Case/Validation/HrValidationTest.php new file mode 100644 index 00000000..94b42f42 --- /dev/null +++ b/Test/Case/Validation/HrValidationTest.php @@ -0,0 +1,32 @@ +assertTrue(HrValidation::postal('25616')); + $this->assertFalse(HrValidation::postal('0989')); + } +} diff --git a/Test/Case/Validation/IdValidatationTest.php b/Test/Case/Validation/IdValidatationTest.php new file mode 100644 index 00000000..3181392f --- /dev/null +++ b/Test/Case/Validation/IdValidatationTest.php @@ -0,0 +1,42 @@ +assertTrue(IdValidation::mobile('08125985608')); + $this->assertFalse(IdValidation::mobile('8125985608')); + } + +/** + * Test the postal method of IdValidation + * + * @return void + */ + public function testPostal() { + $this->assertTrue(IdValidation::postal('15000')); + $this->assertFalse(IdValidation::postal('00091')); + } + +} diff --git a/Test/Case/Validation/RsValidationTest.php b/Test/Case/Validation/RsValidationTest.php index 023d5978..0479f52d 100644 --- a/Test/Case/Validation/RsValidationTest.php +++ b/Test/Case/Validation/RsValidationTest.php @@ -26,11 +26,11 @@ class RsValidationTest extends CakeTestCase { * * @return void */ - public function testJMBG() { - $this->assertTrue(RsValidation::jmbg('1707017170007')); - $this->assertFalse(RsValidation::jmbg('1707017170008')); - $this->assertFalse(RsValidation::jmbg('170701717000')); - $this->assertFalse(RsValidation::jmbg('A707017170007')); + public function testPersonId() { + $this->assertTrue(RsValidation::personId('1707017170007')); + $this->assertFalse(RsValidation::personId('1707017170008')); + $this->assertFalse(RsValidation::personId('170701717000')); + $this->assertFalse(RsValidation::personId('A707017170007')); } /** @@ -38,10 +38,10 @@ public function testJMBG() { * * @return void */ - public function testPostalNumber() { - $this->assertTrue(RsValidation::postal_number('11090')); - $this->assertFalse(RsValidation::postal_number('111000')); - $this->assertFalse(RsValidation::postal_number('A1100')); + public function testPostal() { + $this->assertTrue(RsValidation::postal('11090')); + $this->assertFalse(RsValidation::postal('111000')); + $this->assertFalse(RsValidation::postal('A1100')); } /** @@ -50,8 +50,8 @@ public function testPostalNumber() { * @return void */ public function testAddressCode() { - $this->assertTrue(RsValidation::address_code('122407')); - $this->assertFalse(RsValidation::address_code('11090')); - $this->assertFalse(RsValidation::address_code('A11090')); + $this->assertTrue(RsValidation::addressCode('122407')); + $this->assertFalse(RsValidation::addressCode('11090')); + $this->assertFalse(RsValidation::addressCode('A11090')); } } diff --git a/Validation/HrValidation.php b/Validation/HrValidation.php new file mode 100644 index 00000000..d38f1b97 --- /dev/null +++ b/Validation/HrValidation.php @@ -0,0 +1,56 @@ +