Skip to content
sjlu edited this page May 29, 2012 · 2 revisions

We made Unit Testing easy and pretty. The only thing you need to do is write your unit tests. To do so, go to application/models/unit_model.php and create the unit tests in the appropriate places. When you're done, all you need to do is call index.php/unit from your browser to generate a unit test report.

Writing a unit test

  1. You need to place all your unit tests into application/models/unit_model.php.

  2. Write your tests in the following manner in the function retrieve_tests()

    $tests[] = array( 'rv' => $this->sendit_model->validate_email('tacticalazn@gmail.com'), 'ev' => true, 't' => 'validate_email("tacticalazn@gmail.com")', 'n' => 'Checking if email validation works.' );

Clone this wiki locally