mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-08-06 15:36:28 +02:00
php cs fix
This commit is contained in:
@@ -3,20 +3,17 @@
|
||||
namespace PhpZip;
|
||||
|
||||
use PhpZip\Exception\ZipException;
|
||||
use PhpZip\Util\Iterator\IgnoreFilesFilterIterator;
|
||||
use PhpZip\Util\Iterator\IgnoreFilesRecursiveFilterIterator;
|
||||
|
||||
/**
|
||||
* Test add remote files to zip archive
|
||||
* Test add remote files to zip archive.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @small
|
||||
* @covers
|
||||
*/
|
||||
class ZipRemoteFileTest extends ZipTestCase
|
||||
{
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ZipException
|
||||
*/
|
||||
@@ -25,16 +22,28 @@ class ZipRemoteFileTest extends ZipTestCase
|
||||
$zipFile = new ZipFile();
|
||||
$outputZip = $this->outputFilename;
|
||||
$fileUrl = 'https://raw.githubusercontent.com/Ne-Lexa/php-zip/master/README.md';
|
||||
$fp = @fopen($fileUrl, 'rb', false, stream_context_create([
|
||||
'http' => [
|
||||
'timeout' => 3,
|
||||
]
|
||||
]));
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
$fp = @fopen(
|
||||
$fileUrl,
|
||||
'rb',
|
||||
false,
|
||||
stream_context_create(
|
||||
[
|
||||
'http' => [
|
||||
'timeout' => 3,
|
||||
],
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
if ($fp === false) {
|
||||
self::markTestSkipped(sprintf(
|
||||
"Could not fetch remote file: %s",
|
||||
$fileUrl
|
||||
));
|
||||
static::markTestSkipped(
|
||||
sprintf(
|
||||
'Could not fetch remote file: %s',
|
||||
$fileUrl
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,9 +56,8 @@ class ZipRemoteFileTest extends ZipTestCase
|
||||
$zipFile = new ZipFile();
|
||||
$zipFile->openFile($outputZip);
|
||||
$files = $zipFile->getListFiles();
|
||||
self::assertCount(1, $files);
|
||||
self::assertSame($fileName, $files[0]);
|
||||
static::assertCount(1, $files);
|
||||
static::assertSame($fileName, $files[0]);
|
||||
$zipFile->close();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user