diff options
author | Andrey Andreev <narf@devilix.net> | 2021-09-14 12:47:31 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2021-09-14 12:48:54 +0200 |
commit | 87928371de8a316c9880a451fae04d9785c32840 (patch) | |
tree | 105f60457936882e1d41fcf03c4e7189929951f3 /tests/mocks/ci_testcase.php | |
parent | 063aee9e0f6f560b479958e4fae9f5b77048c8fa (diff) |
Merge pull request #6045 from gxgpet/develop_fixtravis
Fixes Travis pipeline. Adding PHPUnit 8.
Diffstat (limited to 'tests/mocks/ci_testcase.php')
-rw-r--r-- | tests/mocks/ci_testcase.php | 18 |
1 files changed, 16 insertions, 2 deletions
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 @@ <?php -class CI_TestCase extends PHPUnit_Framework_TestCase { +class CI_TestCase extends \PHPUnit\Framework\TestCase { public $ci_vfs_root; public $ci_app_root; @@ -35,7 +35,7 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { public function setUp() { // Setup VFS with base directories - $this->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); + } + } } |