summaryrefslogtreecommitdiffstats
path: root/tests/mocks/ci_testcase.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mocks/ci_testcase.php')
-rw-r--r--tests/mocks/ci_testcase.php16
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);
+ }
+ }
}