kopia lustrzana
https://github.com/nextcloud/server.git
synced 2024-08-29 05:55:50 +02:00
Correctly remove temp test directory tree
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
rodzic
02bfc867ef
commit
b71c9205ef
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Ładowanie…
Reference in New Issue
Block a user