1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-08-06 15:36:28 +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

42
tests/ZipFinderTest.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
namespace PhpZip\Tests;
use PhpZip\Constants\ZipCompressionMethod;
use PhpZip\Constants\ZipOptions;
use PhpZip\Exception\ZipException;
use PhpZip\ZipFile;
use Symfony\Component\Finder\Finder;
/**
* @internal
*
* @small
*/
class ZipFinderTest extends ZipTestCase
{
/**
* @throws ZipException
*/
public function testFinder()
{
$finder = (new Finder())
->files()
->name('*.php')
->in(__DIR__)
;
$zipFile = new ZipFile();
$zipFile->addFromFinder(
$finder,
[
ZipOptions::COMPRESSION_METHOD => ZipCompressionMethod::DEFLATED,
]
);
$zipFile->saveAsFile($this->outputFilename);
static::assertCorrectZipArchive($this->outputFilename);
static::assertSame($finder->count(), $zipFile->count());
$zipFile->close();
}
}