04-28-2019, 12:34 AM
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
ci-phpunit-test for CodeIgniter 3.0
|
04-28-2019, 12:34 AM
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
04-30-2019, 03:54 PM
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?
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
09-03-2019, 04:49 AM
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>
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
12-21-2020, 11:35 PM
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!
12-22-2020, 04:55 PM
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
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
|