In most framework unit testing implementations, you have a set of a tests and you execute those tests from a single [console] command. The tests run and a result is given. That result varies but generally it includes pass / fail.
CodeIgniter’s unit testing framework appears different and I have noticed an extensive collection of random tack-on-projects to either enhance or replace the CodeIgniter unit testing framework.
My question is this: What is the intended work flow or use of the unit testing framework built in to CodeIgniter?
I read the documentation; I get it. It’s a simple class. But where does one utilize the class?
For example, do all the tests go in to a single “test” controller? Or do the tests get intermingled in to each controller? Then there is the question of the models and custom helpers... Also, I'm assuming tests are run via a browser (or the alike) request...
Thanks for the guidance!
Regards,
Frank
I've received an answer from another source and I want to post it here since I am aware of it.
The basic answer is that the CI (CodeIgniter) unit test class is not intended like a traditional unit test suite (JUnit, NUnit, or python's unittest). In CI, the class is intended to be used within the target (the testing target's code base).
To be clear: I'm not endorsing this nor am I sure this is the intended use of the CI unit_test class. This is just what I was told thus far. Perhaps others heard this too and can vote it up. If this is voted up or has support via comments, I'll mark this as an answer. I am still interested in differing opinions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With