diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-12-28 13:41:38 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-01-03 22:05:03 +0100 |
commit | 9fa49c7f24a591567c1d829e53796b32e6268f13 (patch) | |
tree | 8d75ad7165ed24ba2c3718330d62b053aa05cf31 | |
parent | 87b1839cd1f713bb50c4491ddc8714e6331c8cbd (diff) | |
download | nextcloud-server-9fa49c7f24a591567c1d829e53796b32e6268f13.tar.gz nextcloud-server-9fa49c7f24a591567c1d829e53796b32e6268f13.zip |
Correctly remove temp test directory tree
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | tests/lib/Template/SCSSCacherTest.php | 14 |
1 files changed, 13 insertions, 1 deletions
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); } } |