Installing and using the framework



  1. Install Mach II (v1.0.9) if you want to use the TestRunner.
  2. Extract the code into your web root. For example /webserver/wwwroot/CFTestingKit.
  3. Create a mapping to the CFTestingKit folder. For example CFTestingKit maps to /webserver/wwwroot/CFTestingKit.
  4. Never deploy the framework and the test cases on a production instance, but on test and staging environments.

See the Getting Started tutorial for more information.

Getting started

A test case defines the fixture to run multiple tests. To define a test case:

Test methods prefixed with test, such as <cffunction name="testSomething"></cffunction> are automatically recognized as test cases by the CFTestingKit framework.

Using TestRunner

TestRunner is a user interface for running the test cases. It scans the web root and displays a list of available test cases.

The test cases must be installed in a (test) folder. For example /webserver/wwwroot/MyCalculator/(test)/MathTest.cfc. The () provide a visual cue to remind you to not deploy the test cases on a production instance.

The TestRunner is not mandatory. You can write your own user interface by exploiting the TestSuite and TestResult components. See the online tutorial for more information.