The test model in Tao 2.5 is defined by the interface taoTests_models_classes_TestModel
The test model must implement the following functions:
A public constructor in order to ensure that taoTests can instantiate it.
Called when the label of a test changes
$items = array())
Creates a test content specific to the test model. If possible this content should be based on
This function is called whenever a test model is assigned to an test.
This should delete the content of the test, however not the compiled content.
Usually called on deletion of test or change of test model.
Should return the items of the test if possible. Should the test model change these items will be used as basis for the new test model.
Should return the html of the authoring widget for this test model
Should clone the content of the test
$source and assign the cloned content as the content of the test
Returns an instance of the abstract class tao_models_classes_Compiler, which has been initalised for
The test compiler needs to implement the abstract method:
This function will prepare a datastructure for the test that is exploitable by the test runner. The provided
$destinationDirectory can be used for storage. Typically this will involve compiling the items of the test as well, which will be compiled using a similar compiler:
$itemCompiler = taoItems_models_classes_ItemsService::singleton()->getCompiler($item); $serviceCall = $compiler->compile($itemCompiler);
This method should return an instance of tao_models_classes_service_ServiceCall that points to the testrunner and provides the nescessary parameters to run this test.