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

solving problems with lack of memory, the new ZipReader and ZipWriter class, adds .phpstorm.meta.php

#13
#16
#27
#31
#41
This commit is contained in:
Ne-Lexa
2019-12-30 18:47:37 +03:00
parent 28e220718c
commit f377b889b5
126 changed files with 12805 additions and 7819 deletions

47
tests/Zip64Test.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
namespace PhpZip\Tests;
use PhpZip\Exception\ZipException;
use PhpZip\ZipFile;
/**
* Class Zip64Test.
*
* @internal
*
* @medium
*/
class Zip64Test extends ZipTestCase
{
/**
* Test support ZIP64 ext (slow test - normal).
* Create > 65535 files in archive and open and extract to /dev/null.
*
* @throws ZipException
*/
public function testOver65535FilesInZip()
{
$countFiles = 0xffff + 1;
$zipFile = new ZipFile();
for ($i = 0; $i < $countFiles; $i++) {
$zipFile[$i . '.txt'] = (string) $i;
}
$zipFile->saveAsFile($this->outputFilename);
$zipFile->close();
static::assertCorrectZipArchive($this->outputFilename);
$zipFile->openFile($this->outputFilename);
static::assertSame($zipFile->count(), $countFiles);
$i = 0;
foreach ($zipFile as $entry => $content) {
static::assertSame($entry, $i . '.txt');
static::assertSame($content, (string) $i);
$i++;
}
$zipFile->close();
}
}