diff --git a/phpunit.xml b/phpunit.xml index 8e425f9..5693a09 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -12,7 +12,7 @@ > - tests/Valitron + tests/Valitron diff --git a/tests/Valitron/BaseTestCase.php b/tests/Valitron/BaseTestCase.php new file mode 100644 index 0000000..0dec6c4 --- /dev/null +++ b/tests/Valitron/BaseTestCase.php @@ -0,0 +1,24 @@ +tearDown(); + } + + public function tearDown() + { + $this->resetProperty('_lang'); + $this->resetProperty('_langDir'); + $this->resetProperty('_ruleMessages', array()); + } + + protected function resetProperty($name, $value = null) + { + $prop = new ReflectionProperty('Valitron\Validator', $name); + $prop->setAccessible(true); + $prop->setValue($value); + $prop->setAccessible(false); + } +} diff --git a/tests/Valitron/ErrorMessages.php b/tests/Valitron/ErrorMessages.php index b517e2f..51f7f19 100644 --- a/tests/Valitron/ErrorMessages.php +++ b/tests/Valitron/ErrorMessages.php @@ -1,7 +1,7 @@ resetProperty('_lang'); - $this->resetProperty('_langDir'); - $this->resetProperty('_ruleMessages', array()); - } - - protected function resetProperty($name, $value = null) - { - $prop = new ReflectionProperty('Valitron\Validator', $name); - $prop->setAccessible(true); - $prop->setValue($value); - $prop->setAccessible(false); - } - protected function getLangDir() { return __DIR__.'/../../lang'; diff --git a/tests/Valitron/Validate.php b/tests/Valitron/ValidateTest.php similarity index 99% rename from tests/Valitron/Validate.php rename to tests/Valitron/ValidateTest.php index 8f61764..b3d5d1b 100644 --- a/tests/Valitron/Validate.php +++ b/tests/Valitron/ValidateTest.php @@ -1,7 +1,7 @@