Welcome Guest, Not a member yet? Register   Sign In
How to testing code modules?

I created an authentication library for CI4 as code module, now i would like to unit testing the module. But the documentation does not provide guidelines for unit testing for libraries. For unit testing for code modules, there is no guide at all.

My application structure:
--auth <-- I would like to write tests in this folder

What specific guidance are you looking for? You would test that, using phpunit provided, like you would test any class. The testing tools aren't complete yet, but you can look at any of the tests in /system to see how to use things. You can also test controllers, and more with the existing tools. I'm very close to having HTTP testing tools ready, which included a refactor of how some of the core code worked to make testing even easier, and hope to have that pushed to the repo by the end of the week. Having to update all of the other tests in the system to work with the refactored CodeIgniter.php and CIUnitTestCase. And I need to write up that docs for it. Smile

If you have specific questions we can be of more help.

Theme © iAndrew 2016 - Forum software by © MyBB