diff options
Diffstat (limited to 'tests/lib/Archive/ZIPTest.php')
-rw-r--r-- | tests/lib/Archive/ZIPTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php new file mode 100644 index 00000000000..0996d5abf61 --- /dev/null +++ b/tests/lib/Archive/ZIPTest.php @@ -0,0 +1,28 @@ +<?php + +/** + * 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() { + $dir = \OC::$SERVERROOT . '/tests/data'; + return new ZIP($dir . '/data.zip'); + } + + protected function getNew() { + $newZip = Server::get(ITempManager::class)->getTempBaseDir() . '/newArchive.zip'; + if (file_exists($newZip)) { + unlink($newZip); + } + return new ZIP($newZip); + } +} |