Run tests

From ATK Wiki

Jump to: navigation, search

Hier hoort informatie over automatische tests voor het SimpleTest framework voor Platform (>M6) en ATK (>5)

Run tests

Tests can be executed by browsing to test.php (same folder where index.php is).

 So for browsing a site you go to 
 And for the admin you go to 
 then you can find the test on

ATK will search the entire application for .php and .inc files with 'test_' in the filename, execute the setUp() function, run the 'test_' functions and finally execute the tearDown() function.

Run Selective

If you want to test a single module, you can use the atkmodule parameter:


ATK will execute only the tests it can find in that module.

If you want to execute the tests of a single testcase you can do something like this:


The test framework will only execute the 'test_' functions in this single testcase.

TIP: If you use the include option the framework must still search the entire application for this testcase, since it does not keep track of their locations. This might take several valuable seconds and use quite some memory. This is why there is another test option for running a single testcase where you can include the location:



This will load ./platform/atk/db/testcases/ and perform its tests.

The class option also works for files that would not be found because they don't have 'test_' in the filename. Since the test framework does not need to search for testcases, it will simply load any given testcase.



Writing tests

See: Writing tests

Personal tools