Unit testing with codeigniter 2.2 |
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.
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.
enlivenapp the best way is to update the ci version and use ci-phpunit-test.
(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.
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.
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.
CI has a upgrading guide https://www.codeigniter.com/user_guide/i...ading.html
For me it was an easy task. If you have any problems or errors ask in the forum. (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 |
Welcome Guest, Not a member yet? Register Sign In |