Unit testing with codeigniter 2.2 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Unit testing with codeigniter 2.2 (/showthread.php?tid=67142) |
Unit testing with codeigniter 2.2 - aaldhahe - 01-20-2017 Hello all, I am taking over an existing application in codeigniter 2.2 and I have to perform unit testing. What are the possible frameworks available to integrate codeigniter 2.2 with phpunit? Also, is there a unit_test class for codeigniter 2.2? I have been trying to find a solution for the past three days and no luck yet. RE: Unit testing with codeigniter 2.2 - enlivenapp - 01-20-2017 Take a look at this: https://github.com/kenjis/ci-phpunit-test It's currently for 3.x, but with some tweaking it should work with 2.x as well. RE: Unit testing with codeigniter 2.2 - Paradinight - 01-21-2017 enlivenapp the best way is to update the ci version and use ci-phpunit-test. RE: Unit testing with codeigniter 2.2 - enlivenapp - 01-21-2017 (01-21-2017, 01:53 AM)Paradinight Wrote: enlivenapp the best way is to update the ci version and use ci-phpunit-test. I answered his question. Yeah, he should upgrade to latest CI for lots of reasons and I'm willing to bet he already knows he's not using the latest, so I assumed he has a reason not to upgrade. Whatever the reason(s) is, it wasn't part of the question. RE: Unit testing with codeigniter 2.2 - Paradinight - 01-21-2017 Not to upgrade is the wrong way and you answer is wrong. The last update was on 31 Oct 2015. Security is very important... . A old version is not secure. RE: Unit testing with codeigniter 2.2 - enlivenapp - 01-21-2017 It's not my moral obligation to berate every person here asking questions about updating to the latest version of whatever. If you have/had a better answer for his actual question, answer the OP and get back on topic. RE: Unit testing with codeigniter 2.2 - Paradinight - 01-22-2017 CI has a upgrading guide https://www.codeigniter.com/user_guide/installation/upgrading.html For me it was an easy task. If you have any problems or errors ask in the forum. RE: Unit testing with codeigniter 2.2 - kenjis - 01-23-2017 (01-20-2017, 08:20 PM)enlivenapp Wrote: Take a look at this: https://github.com/kenjis/ci-phpunit-test Unfortunately, I think tweaking it with 2.x is not so easy. Because it is very tightly coupled with CI3. It replaces CI files including core files internally. It was written for CI3 from scratch. CI2 and 3 are similar to users, but 3 has a lot of lot of improvements (a little changes). So if you use ci-phpunit-test with CI2, you need to take care of all the changes. I recommend you upgrade CI to version 3, if you could. But if not, the following project might help you: https://github.com/fmalk/codeigniter-phpunit/tree/2.x |