public static function tearDownAfterClass() { parent::tearDownAfterClass(); /* Since we will have set up a temporary file to log exceptions by virtue of instantiating the mock API object, we need to undo it to set up any remaining tests correctly. */ RuntimeException::unregisterLogger(); }
public static function tearDownAfterClass() { parent::tearDownAfterClass(); /* This is important or the next test that throws a LoggingException will try and fail to write to the temporary file we're about to delete. */ RuntimeException::unregisterLogger(); $dirH = opendir(GOOGLE_ANALYTICS_API_DATA_DIR); if ($dirH !== false) { while (false !== ($entry = readdir($dirH))) { $path = GOOGLE_ANALYTICS_API_DATA_DIR . DIRECTORY_SEPARATOR . $entry; if (!is_dir($path) && !unlink($path)) { throw new \RuntimeException('Unable to delete ' . $path . '.'); } } closedir($dirH); if (!rmdir(GOOGLE_ANALYTICS_API_DATA_DIR)) { throw new \RuntimeException('Unable to remove directory ' . GOOGLE_ANALYTICS_API_DATA_DIR . '.'); } } }