From f793bb75551cfa2611db2f0a707dcd011428b140 Mon Sep 17 00:00:00 2001 From: Marcos Neves Date: Mon, 19 Aug 2013 12:31:11 -0300 Subject: [PATCH] missing language file now raises InvalidArgumentException --- src/Valitron/Validator.php | 9 ++++++++- tests/Valitron/{StaticLangTest.php => LangTest.php} | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) rename tests/Valitron/{StaticLangTest.php => LangTest.php} (77%) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index 04a6244..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'); + } }