aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Archive/ZIPTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Archive/ZIPTest.php')
-rw-r--r--tests/lib/Archive/ZIPTest.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php
index 25707e4b051..0996d5abf61 100644
--- a/tests/lib/Archive/ZIPTest.php
+++ b/tests/lib/Archive/ZIPTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -8,6 +9,8 @@
namespace Test\Archive;
use OC\Archive\ZIP;
+use OCP\ITempManager;
+use OCP\Server;
class ZIPTest extends TestBase {
protected function getExisting() {
@@ -16,6 +19,10 @@ class ZIPTest extends TestBase {
}
protected function getNew() {
- return new ZIP(\OC::$server->getTempManager()->getTempBaseDir() . '/newArchive.zip');
+ $newZip = Server::get(ITempManager::class)->getTempBaseDir() . '/newArchive.zip';
+ if (file_exists($newZip)) {
+ unlink($newZip);
+ }
+ return new ZIP($newZip);
}
}