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.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php
index 14443471da1..0996d5abf61 100644
--- a/tests/lib/Archive/ZIPTest.php
+++ b/tests/lib/Archive/ZIPTest.php
@@ -1,14 +1,16 @@
<?php
+
/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Archive;
use OC\Archive\ZIP;
+use OCP\ITempManager;
+use OCP\Server;
class ZIPTest extends TestBase {
protected function getExisting() {
@@ -17,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);
}
}