SimpleTester Unit testing library

PiotrPiorecki edited this page Feb 20, 2013 · 24 revisions
Clone this wiki locally

Category:Library | Category:Library::Community | Category:Library::Tests

SimpleTester is a testing library for CodeIgniter, wrapping the SimpleTest framework.

Installation instructions

  1. Download SimpleTester 1.1 here:
  2. Unzip file to the application folder.
  3. Download the latest SimpleTest framework here.
  4. Gunzip that file to application/libraries (a folder called “simpletest” should be created in application/libraries)
  5. Add “simpletester” to autoloading libraries in config/autoload.php
  6. Installation complete! Run your application. A small box should appear on the top right of the page, confirming that the default tests passed.
  7. Now you can check out the test file templates in application/tests, and the SimpleTester configuration file in config. Try to change a test in a template test file to see if the installation really works. By failing a test, a big red bar should appear on the top of the page.
  8. Put all your test files in “application/tests”. Use the template files for a quicker start.[/quote]

If you haven't heard of the SimpleTest framework before, it's well worth a look:

Note for machines with IP !=

If you develop on a machine where PHP doesn’t see the server IP as, the tests won't run automatically in the default configuration. You must change the configuration file to allow the IP your development machine has.