1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-07-30 20:20:11 +02:00

Implemented the ability to override the instance of ZipContainer.

ZipContainer will be cloned before writing the zip file.
Tested custom ZipWriter, ZipReader, ZipContainer and ZipFile.
This commit is contained in:
Ne-Lexa
2020-01-21 14:10:47 +03:00
parent e0da8c94be
commit 5ec656fde4
15 changed files with 472 additions and 7 deletions

View File

@@ -2418,4 +2418,21 @@ class ZipFileTest extends ZipTestCase
static::assertSame($zipFile->getEntry($newEntryName)->getCompressionMethod(), ZipCompressionMethod::STORED);
$zipFile->close();
}
/**
* @throws ZipEntryNotFoundException
* @throws ZipException
*/
public function testCloneZipContainerInZipWriter()
{
$zipFile = new ZipFile();
$zipFile['file 1'] = 'contents';
$zipEntryBeforeWrite = $zipFile->getEntry('file 1');
$zipFile->saveAsFile($this->outputFilename);
$zipAfterBeforeWrite = $zipFile->getEntry('file 1');
static::assertEquals($zipAfterBeforeWrite, $zipEntryBeforeWrite);
$zipFile->close();
}
}