This works however the output in my setup and teardown methods gets called before the output of the test results. Do you know how to get the performance results to post with the test itself?
The output I get now is:
Total Time: 0.000220775604248
Total Time: 0.000128984451294
Total Time: 0.010162115097
Total Time: 1.1899459362
TestCase CFETest->test_get_application_dropdown() passed
TestCase CFETest->test_get_event_list() passed
TestCase CFETest->test_get_device_list() failed: expected 1, actual 0
TestCase CFETest->test_get_application_list() failed: expected 1, actual 0
My setUp function is:
function setUp() {
global $starttime;
//create some money objects...
$this->cfengine_api = new cfengine_api($smarty);
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}
And my teardown is:
function tearDown() {
global $starttime;
$this->cfengine_api = NULL;
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
print "Total Time: $totaltime\n";
}
I'm executing my tests via:
$suite = new PHPUnit_TestSuite( "CFETest" );
$result = PHPUnit::run($suite);
Thank you for your reply!