public function testCleanDir() { $dir = self::$_tmpDir . '/subtmp'; mkdir($dir, 0777); $fileName = $dir . '/file.tmp'; touch($fileName); try { $this->_environment->cleanDir(self::$_tmpDir); $this->assertFalse(is_dir($dir)); } catch (Exception $e) { if (file_exists($fileName)) { unlink($fileName); } rmdir($dir); throw $e; } }