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

zip extra tests, php 32-bit compat

This commit is contained in:
Ne-Lexa
2020-01-14 16:31:22 +03:00
parent d21fdb35bb
commit 8487dac9df
13 changed files with 246 additions and 122 deletions

View File

@@ -266,7 +266,7 @@ class ZipEntryTest extends TestCase
$dosEntryName = DosCodePage::fromUTF8($entryName, $charset);
static::assertSame(DosCodePage::toUTF8($dosEntryName, $charset), $entryName);
$unicodePathExtraField = UnicodePathExtraField::create($entryName);
$unicodePathExtraField = new UnicodePathExtraField(crc32($dosEntryName), $entryName);
$zipEntry = new ZipEntry($dosEntryName, $charset);
static::assertSame($zipEntry->getName(), $dosEntryName);
@@ -800,6 +800,12 @@ class ZipEntryTest extends TestCase
*/
public function testInvalidDosTime($dosTime)
{
if (\PHP_INT_SIZE === 4) {
static::markTestSkipped('only 64 bit test');
return;
}
$this->setExpectedException(InvalidArgumentException::class, 'DosTime out of range');
$zipEntry = new ZipEntry('entry');
@@ -951,6 +957,12 @@ class ZipEntryTest extends TestCase
*/
public function testInvalidExternalAttributes($externalAttributes)
{
if (\PHP_INT_SIZE === 4) {
static::markTestSkipped('only 64 bit test');
return;
}
$this->setExpectedException(InvalidArgumentException::class, 'external attributes out of range');
$zipEntry = new ZipEntry('entry');