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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user