diff --git a/src/Environment.php b/src/Environment.php
index <HASH>..<HASH> 100644
--- a/src/Environment.php
+++ b/src/Environment.php
@@ -92,8 +92,7 @@ class Environment
 		self::purge(TEMP_DIR);
 
 		register_shutdown_function(function () {
-			self::purge(TMP_DIR);
-			@rmdir(TMP_DIR);
+			self::rmdir(TEMP_DIR);
 		});
 	}
 
@@ -170,6 +169,17 @@ class Environment
 	 * @param string $dir
 	 * @return void
 	 */
+	public static function rmdir($dir)
+	{
+		if (!is_dir($dir)) return;
+		self::purge($dir);
+		@rmdir($dir);
+	}
+
+	/**
+	 * @param string $dir
+	 * @return void
+	 */
 	private static function purge($dir)
 	{
 		THelpers::purge($dir);
Environment: cleanup only TEMP_DIR (single test-case)