Bolt\Tests\BoltListener::cleanTestEnv PHP Метод

cleanTestEnv() приватный Метод

Clean up after test runs
private cleanTestEnv ( )
    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 "\nTest timings written out to: " . $file . "\n\n";
        }
    }