CodeIgniter Forums
Unit test CI project - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Unit test CI project (/showthread.php?tid=1600)



Unit test CI project - chelw117 - 03-24-2015

I am currently using PHPUnit to unit test CI projects. However, there are not suitable tools for me to integrate PHPUnit with CI. I searched online and found that tools such as CIUnit are no longer updated. So are there any recommended tools to test CI project with PHPUnit?


RE: Unit test CI project - s4if - 03-25-2015

i have same problem here, for now i have solution using this project (https://github.com/fmalk/codeigniter-phpunit/tree/master) to setup my testing environment. even though i'm still searching how to mock some ci library (like session library, etc). i hope this will help you.


RE: Unit test CI project - chelw117 - 03-25-2015

Thanks, dude. I have used that project, but it seems not very popular.
(03-25-2015, 07:00 AM)s4if Wrote: i have same problem here, for now i have solution using this project (https://github.com/fmalk/codeigniter-phpunit/tree/master) to setup my testing environment. even though i'm still searching how to mock some ci library (like session library, etc). i hope this will help you.



RE: Unit test CI project - rodolfosilva - 04-02-2015

Give up trying to find the CIUnit to CodeIgniter 3. And I decided to update the CIUnit2 for CIUnit3 following repository: https://github.com/RodolfoSilva/CIUnit-for-CI3


RE: Unit test CI project - alkarim - 04-23-2015

Have anyone tried codelobster?


RE: Unit test CI project - kenjis - 05-09-2015

Hi, I'm building a new tool for CodeIgniter 3.0.

CI PHPUnit Test: https://github.com/kenjis/ci-phpunit-test


RE: Unit test CI project - kilishan - 05-10-2015

(03-24-2015, 08:23 PM)chelw117 Wrote: I am currently using PHPUnit to unit test CI projects. However, there are not suitable tools for me to integrate PHPUnit with CI.

What type of tools do you need? It's just PHPUnit at it's simplest. You will need to do a touch of prepping to get the CI object available to your tests. The best place to start is to probably examine the tests that come with CodeIgniter as they are all done in PHPUnit. The Bootstrap.php file that it comes with looks to do a pretty thorough job of setting up the environment for you, and there's plenty of tests to look at for examples.