From 1435060c761da9777dd6ef59f12d56a65ea90e12 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sat, 15 Jan 2022 19:39:41 +0100 Subject: [PATCH] Added test case for ZipArchive --- src/ZipArchive/ZipArchiveAdapterTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ZipArchive/ZipArchiveAdapterTest.php b/src/ZipArchive/ZipArchiveAdapterTest.php index 2dafd550a..7bbd5c550 100644 --- a/src/ZipArchive/ZipArchiveAdapterTest.php +++ b/src/ZipArchive/ZipArchiveAdapterTest.php @@ -17,6 +17,8 @@ use League\Flysystem\UnableToWriteFile; use League\Flysystem\Visibility; +use function iterator_to_array; + /** * @group zip */ @@ -227,6 +229,20 @@ public function failing_to_set_visibility_because_the_file_does_not_exist(): voi $this->adapter()->setVisibility('path.txt', Visibility::PUBLIC); } + /** + * @test + */ + public function deleting_a_directory_with_files_in_it(): void + { + $this->givenWeHaveAnExistingFile('nested/path-a.txt'); + $this->givenWeHaveAnExistingFile('nested/path-b.txt'); + + $this->adapter()->deleteDirectory('nested'); + $listing = iterator_to_array($this->adapter()->listContents('', true)); + + self::assertEquals([], $listing); + } + /** * @test */