From 87928371de8a316c9880a451fae04d9785c32840 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 14 Sep 2021 13:47:31 +0300 Subject: Merge pull request #6045 from gxgpet/develop_fixtravis Fixes Travis pipeline. Adding PHPUnit 8. --- tests/mocks/ci_testcase.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'tests/mocks') diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php index 8dc4682ef..de46f6df6 100644 --- a/tests/mocks/ci_testcase.php +++ b/tests/mocks/ci_testcase.php @@ -1,6 +1,6 @@ ci_vfs_root = vfsStream::setup(); + $this->ci_vfs_root = vfsStream::setup(''); $this->ci_app_root = vfsStream::newDirectory('application')->at($this->ci_vfs_root); $this->ci_base_root = vfsStream::newDirectory('system')->at($this->ci_vfs_root); $this->ci_view_root = vfsStream::newDirectory('views')->at($this->ci_app_root); @@ -381,4 +381,18 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { return parent::__call($method, $args); } + public function setExpectedException($exception_class, $exception_message = '', $exception_code = null) + { + $use_expect_exception = method_exists($this, 'expectException'); + + if ($use_expect_exception) + { + $this->expectException($exception_class); + $exception_message !== '' && $this->expectExceptionMessage($exception_message); + } + else + { + parent::setExpectedException($exception_class, $exception_message, $exception_code); + } + } } -- cgit v1.2.3-24-g4f1b