ci-phpunit-test for CodeIgniter 3.0 |
I have started development in 2.x branch, which goes with PHPUnit 8.1 and PHP 7.2.
https://github.com/kenjis/ci-phpunit-test/tree/2.x By the way, I want to hear from you guys. Do you use Composer to install ci-phpunit-test or not?
Hi kenjis
I have a problem with this package. when I use phpunit this error occur in my cmd: (( PHPUnit 3.7.21 by Sebastian Bergmann. The Xdebug extension is not loaded. No code coverage will be generated. FPHP Fatal error: Declaration of PHPUnit_Framework_Comparator_DOMDocument::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with PHPUnit_Framework_Comparator_Object::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in C:\xampp\php\pear\PHPUnit\Framework\Comparator\DOMDocument.php on line 114 Fatal error: Declaration of PHPUnit_Framework_Comparator_DOMDocument::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with PHPUnit_Framework_Comparator_Object::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in C:\xampp\php\pear\PHPUnit\Framework\Comparator\DOMDocument.php on line 114 A PHP Error was encountered Severity: Compile Error Message: Declaration of PHPUnit_Framework_Comparator_DOMDocument::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with PHPUnit_Framework_Comparator_Object::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) Filename: C:\xampp\php\pear\PHPUnit\Framework\Comparator\DOMDocument.php Line Number: 114 Backtrace: )) please help me.
@imalegend
> PHPUnit 3.7.21 by Sebastian Bergmann. Your PHPUnit version is too old. See <https://github.com/kenjis/ci-phpunit-test#requirements>
Hi Kenjis, and thank you very much for your hard work, it has helped me to learn more about testing.
I'm trying to test an abstract controller I wrote that lives in the core directory(application/core). This controller is not meant to be accessed directly, it's there only to be inherited from, and so I can not access it via $this->request('GET', ). Any ideas as to how I can test under this situation? Thanks in advance!
My pleasure.
You don't have to test abstract classes. Test your concrete classes. The behavior of an abstract class could test via testing a concrete class which inherits it. If you really want to test abstract classes, you could use PHPUnit getMockForAbstractClass(). https://phpunit.readthedocs.io/en/8.5/te...ct-classes
I have updated sample repository for HMVC and ci-phpunit-test.
https://github.com/kenjis/ci-hmvc-ci-phpunit-test
I added test code to CodeIgniter 3 News Tutorial.
https://github.com/kenjis/ci3-news/tree/...tion/tests
If you plan to upgrade to CI4, this might be help for you.
(02-17-2021, 11:57 PM)kenjis Wrote: I added test code to CodeIgniter 3 News Tutorial. I upgraded the CI3 News Tutorial to CI4 using CodeIgniter 3 to 4 Upgrade Helper. And I also upgraded the test code! https://github.com/kenjis/ci3-to-4-news/.../tests/app CodeIgniter 3 to 4 Upgrade Helper https://forum.codeigniter.com/thread-78565.html
v0.19.0 was released!
Enjoy testing! https://github.com/kenjis/ci-phpunit-tes...ag/v0.19.0 Hi, all! Now I maintain PHP 5.4 to PHP 7.4, 8 PHP versions, and PHPUnit 4.8 to 9.5. https://travis-ci.org/github/kenjis/ci-p.../761109019 https://travis-ci.org/github/kenjis/ci-p.../761110518 What versions of PHPUnit and PHP are you using? |
Welcome Guest, Not a member yet? Register Sign In |