From 9fa49c7f24a591567c1d829e53796b32e6268f13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 28 Dec 2017 13:41:38 +0100 Subject: [PATCH] Correctly remove temp test directory tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- tests/lib/Template/SCSSCacherTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/lib/Template/SCSSCacherTest.php b/tests/lib/Template/SCSSCacherTest.php index 97a2879c942..712c00262d6 100644 --- a/tests/lib/Template/SCSSCacherTest.php +++ b/tests/lib/Template/SCSSCacherTest.php @@ -399,6 +399,18 @@ class SCSSCacherTest extends \Test\TestCase { return sha1(uniqid(mt_rand(), true)); } + private function rrmdir($directory) { + $files = array_diff(scandir($directory), array('.','..')); + foreach ($files as $file) { + if (is_dir($directory . '/' . $file)) { + $this->rrmdir($directory . '/' . $file); + } else { + unlink($directory . '/' . $file); + } + } + return rmdir($directory); + } + /** * @param $path * @param $appName @@ -418,7 +430,7 @@ class SCSSCacherTest extends \Test\TestCase { $actual = self::invokePrivate($this->scssCacher, 'getWebDir', [$tmpDir.$path, $appName, $tmpDir.$serverRoot, $webRoot]); $this->assertEquals($correctWebDir, $actual); array_pop(\OC::$APPSROOTS); - rmdir($tmpDir.$path); + $this->rrmdir($tmpDir.$path); } } -- 2.39.5