CodeIgniter Forums
ci-phpunit-test for CodeIgniter 3.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: ci-phpunit-test for CodeIgniter 3.0 (/showthread.php?tid=61725)

Pages: 1 2 3 4 5 6 7 8 9 10 11


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 04-28-2019

Hi there,

I've released ci-phpunit-test v0.17.0!

https://github.com/kenjis/ci-phpunit-test/releases


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 04-30-2019

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?


RE: ci-phpunit-test for CodeIgniter 3.0 - imalegend - 09-03-2019

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.


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 10-19-2019

@imalegend

> PHPUnit 3.7.21 by Sebastian Bergmann.

Your PHPUnit version is too old.

See <https://github.com/kenjis/ci-phpunit-test#requirements>


RE: ci-phpunit-test for CodeIgniter 3.0 - Creativa - 12-21-2020

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!


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 12-22-2020

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/test-doubles.html#mocking-traits-and-abstract-classes


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 01-28-2021

I have updated sample repository for HMVC and ci-phpunit-test.
https://github.com/kenjis/ci-hmvc-ci-phpunit-test



RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 02-17-2021

I added test code to CodeIgniter 3 News Tutorial.
https://github.com/kenjis/ci3-news/tree/main/application/tests


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 02-19-2021

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.
https://github.com/kenjis/ci3-news/tree/main/application/tests

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/tree/main/tests/app

CodeIgniter 3 to 4 Upgrade Helper
https://forum.codeigniter.com/thread-78565.html


RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 03-02-2021

v0.19.0 was released!
Enjoy testing!

https://github.com/kenjis/ci-phpunit-test/releases/tag/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-phpunit-test/builds/761109019
https://travis-ci.org/github/kenjis/ci-phpunit-test/builds/761110518

What versions of PHPUnit and PHP are you using?