Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

Unit testing best practices

$
0
0
I am aware of: https://www.codeigniter.com/userguide3/libraries/unit_testing.html
However, my question is what are the best practices in CI for unit testing?



Should I have test methods in my controllers and models?
Or
Should I extend every controller and model and do the tests there?


Should I use the default unit testing class
Or
Should I use an outside tester?


Can I run tests in CLI
Or
Only in browser?


What is the preferred way to test for exceptions?

For example, I have a method that if you don't supply with a valid parameters, will throw a BadRequestException
How can I say: valid parameters, did not through exception
Invalid parameters: threw BadRequestException



Thanks!

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>