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:
42
tests/ZipFinderTest.php
Normal file
42
tests/ZipFinderTest.php
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user