aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Template
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2017-12-28 13:41:38 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2017-12-30 05:55:45 +0100
commitb71c9205ef784b7aa55f5f51207f9ba49e077a2f (patch)
treeb143aceab395fae3325db8478770b14956f68139 /tests/lib/Template
parent02bfc867efd992c6b5b17bcdc76316cb1c970853 (diff)
downloadnextcloud-server-b71c9205ef784b7aa55f5f51207f9ba49e077a2f.tar.gz
nextcloud-server-b71c9205ef784b7aa55f5f51207f9ba49e077a2f.zip
Correctly remove temp test directory tree
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests/lib/Template')
-rw-r--r--tests/lib/Template/SCSSCacherTest.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/lib/Template/SCSSCacherTest.php b/tests/lib/Template/SCSSCacherTest.php
index 6ecfc0e7aa1..7a1c5829258 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);
}
}