From 035eca309359e5682ec4f3a99eb203754dc77a76 Mon Sep 17 00:00:00 2001 From: Willem Wollebrants Date: Wed, 7 Jul 2021 11:47:59 +0200 Subject: [PATCH] make tests compatible with phpunit for php8 --- tests/Valitron/LangTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Valitron/LangTest.php b/tests/Valitron/LangTest.php index 61bab65..f5447cb 100644 --- a/tests/Valitron/LangTest.php +++ b/tests/Valitron/LangTest.php @@ -45,9 +45,12 @@ public function testDefaultLangDirShouldBePackageLangDir() public function testLangException() { - $this->expectException("InvalidArgumentException"); - $this->expectExceptionMessage("Fail to load language file '/this/dir/does/not/exists/en.php'"); + try{ new Validator(array(), array(), 'en', '/this/dir/does/not/exists'); + } catch (Exception $exception){ + $this->assertInstanceOf("InvalidArgumentException", $exception); + $this->assertEquals("Fail to load language file '/this/dir/does/not/exists/en.php'", $exception->getMessage()); + } }