diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index cb7cc8e..e25de20 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -1,6 +1,8 @@ assertEquals(realpath($this->getLangDir()), realpath(Validator::langDir())); } + + /** + * @expectedException InvalidArgumentException + * @expectedExceptionMessage fail to load language file '/this/dir/does/not/exists/en.php' + */ + public function testLangException() + { + new Validator(array(), array(), 'en', '/this/dir/does/not/exists'); + } } diff --git a/tests/Valitron/StaticVsInstanceTest.php b/tests/Valitron/StaticVsInstanceTest.php new file mode 100644 index 0000000..c83dad4 --- /dev/null +++ b/tests/Valitron/StaticVsInstanceTest.php @@ -0,0 +1,13 @@ +assertEquals('ar', Validator::lang(), + 'instance defined lang should not replace static global lang'); + } +}