An easier way to use PHPUnit with CodeIgniter 3.x.
ENVIRONMENT
constant value testing
. See #360.config.php
is loaded before constants.php
. See #348.PHPUnit\Framework\MockObject\Stub
does not work. See #307._ci_phpunit_test
directly from vendor path. See #274.$this->request()
and DbTestCase
class at the same time.MonkeyPatch::patchConstant()
when the user does not specify $class_method
. See #251.vendor/kenjis/ci-phpunit-test/update.php
does not work.$this->resetInstance()
could create MY_Controller
instance in stead of CI_Controller
instance. See #271.$this->request()
execution, and throws exceptions. If you want to disable the checking, you must add protected $strictRequestErrorCheck = false;
in your test classes. See #235.$this->newModel()
, $this->newLibrary()
, $this->newController()
in your test cases, please install tests/UnitTestCase.php
manually, and change the base classname of the test cases to UnitTestCase
class. See #233.CI_Output
. If you use MY_Output
, it might delete ci-phpunit-test override for testing. See How to Write Tests for the details.$this->request()
execution, and throws exceptions.$this->newModel()
, $this->newLibrary()
, $this->newController()
moved to UnitTestCase
class.CI_Output
.$this->verifyInvoked*()
. See #192.TESTPATH
in application/tests/Bootstrap.php
.application
and public
directory when you install via Composer. See README.set_status_header()
in controller constructor gets overwritten. See #194.MY_Config
is not loaded in $this->request()
. See #196.$this->getDouble()
. See #170.