diff options
author | George Petculescu <gxgpet@gmail.com> | 2021-05-31 12:28:25 +0200 |
---|---|---|
committer | George Petculescu <gxgpet@gmail.com> | 2021-05-31 12:28:25 +0200 |
commit | 81c793551d2bd6c2919a9a46462d464965c8207f (patch) | |
tree | d1daf5024a3627df8493c8056e202302ca052d10 /tests/mocks | |
parent | 56de63c5bdfd7962d2e64d6d9b0a5b7914d4ec6c (diff) |
Adding PHPUnit 8
Diffstat (limited to 'tests/mocks')
-rw-r--r-- | tests/mocks/ci_testcase.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php index fbd56af03..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; @@ -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); + } + } } |