private function cleanTestEnv()
{
// Empty the cache
system('php ' . NUT_PATH . ' cache:clear');
// Remove the test database
if ($this->reset) {
$fs = new Filesystem();
$fs->remove(PHPUNIT_ROOT . '/resources/files/');
$fs->remove(PHPUNIT_WEBROOT);
}
// Write out a report about each test's execution time
if ($this->timer) {
$file = TEST_ROOT . '/app/cache/phpunit-test-timer.txt';
if (is_readable($file)) {
unlink($file);
}
// Sort the array by value, in reverse order
arsort($this->tracker);
foreach ($this->tracker as $test => $time) {
$time = number_format($time, 6);
file_put_contents($file, "{$time}\t\t{$test}\n", FILE_APPEND);
}
echo "\n[32mTest timings written out to: " . $file . "[0m\n\n";
}
}