1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-10 12:54:29 +02:00

ZipInfo tests

This commit is contained in:
Ne-Lexa
2020-01-31 13:42:19 +03:00
parent 2235de6b35
commit 820c63c30f
3 changed files with 142 additions and 0 deletions

View File

@@ -142,7 +142,9 @@ class ZipFile implements ZipFileInterface
}
if (!($handle = fopen('php://temp', 'r+b'))) {
// @codeCoverageIgnoreStart
throw new ZipException("Can't open temp stream.");
// @codeCoverageIgnoreEnd
}
fwrite($handle, $data);
rewind($handle);
@@ -459,7 +461,9 @@ class ZipFile implements ZipFileInterface
}
if (!mkdir($dir, $dirMode, true) && !is_dir($dir)) {
// @codeCoverageIgnoreStart
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
// @codeCoverageIgnoreEnd
}
chmod($dir, $dirMode);
}
@@ -495,6 +499,7 @@ class ZipFile implements ZipFileInterface
/** @noinspection PhpUsageOfSilenceOperatorInspection */
if (!($handle = @fopen($file, 'w+b'))) {
// @codeCoverageIgnoreStart
throw new ZipException(
sprintf(
'Cannot extract zip entry %s. File %s cannot open for write.',
@@ -502,6 +507,7 @@ class ZipFile implements ZipFileInterface
$file
)
);
// @codeCoverageIgnoreEnd
}
try {