Closed sylouuu closed 9 years ago
@sylouuu thanks for bringing this up. Stock unit testing seems to be a minor improvement from 2.x, so I guess this project is still needed...
Hi! All, after workaround I found.
In CI 3.0rc, the only system/core
file need to overwrite is CodeIgniter.php#L531 which is:
if ($EXT->call_hook('display_override') === FALSE)
must become
if ($EXT->call_hook('display_override') === FALSE && !defined('PHPUNIT_TEST'))
As you can see, you can simply use display_override
hooks as well. :wink:
Then, add is_cli()
function overwrite in you application/tests/bootstrap.php
function is_cli()
{
return;
}
@feryardiant I've put your pull request on a CI3 branch, tagged 3.0. @sylouuu does that work for you? I haven't tested it myself yet.
Hi,
I've added this:
CodeIgniter.php:525
if ($EXT->call_hook('display_override') === FALSE && !defined('PHPUNIT_TEST'))
URI.php:110
if (is_cli() OR ($protocol = strtoupper($this->config->item('uri_protocol'))) === 'CLI' || defined('PHPUNIT_TEST'))
And it works, I don't have the "very latest" CI version, so don't check my line numbers.
Bests :)
@sylouuu You did this yourself, before seeing @feryardiant 's code? Because it seems to me that @feryardiant replaced is_cli()
at bootstrap to do the same as you in URI.php
hack.
Yes I did it before.
I'll close the issue then.
Hi,
CI 3 RC is out, I'd like to use PHPUnit with it. Then we need another hack documentation for this version...
Bests