summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2021-09-14 12:47:31 +0200
committerGitHub <noreply@github.com>2021-09-14 12:47:31 +0200
commit4fa09ccaa80770ed11a2fdf6f1e28c5e14914be4 (patch)
tree69cae04c446204d3500f117048e4092120787b04 /tests/mocks
parent83a4588893dc1cde7d890a2461ac8af6efbf8ad7 (diff)
parentc7e171e0d83d7092d459c2754a1ee3aba33e43ef (diff)
Merge pull request #6045 from gxgpet/develop_fixtravis
Fixes Travis pipeline. Adding PHPUnit 8.
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/ci_testcase.php18
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);
+ }
+ }
}