Files
Gustavo Lopes 78b7a5f63b Add musl-based build environment and Docker CI infrastructure
Add a musl/LLVM Docker build environment for compiling portable Linux
binaries that work on both musl and glibc systems, along with a minimal
PHP Docker image for testing. Add CI workflows to build and publish
these images to ghcr.io. Update test and build scripts to use the new
Docker-based environment, and remove SKIPIF guards from tests since the
extension is always present and doing otherwise would mask extension
loading failures.
2026-03-14 22:31:52 +00:00

49 lines
911 B
PHP

--TEST--
RarEntry::extract() method (corrupt RAR file)
--FILE--
<?php
$rar_file1 = rar_open(dirname(__FILE__).'/corrupted.rar');
$entries = rar_list($rar_file1);
echo count($entries)." files (will test only the first 4):\n\n";
//var_dump($entries);
$i = 0;
foreach ($entries as $e) {
if ($i++ >= 4)
break;
echo "Extraction of file #$i:\n";
$ret = $e->extract(false, dirname(__FILE__).'/temp.txt');
if ($ret)
echo "\tSUCCESS\n";
else
echo "\tFAILED\n";
echo "\n";
}
@unlink(dirname(__FILE__).'/temp.txt');
echo "Done\n";
?>
--EXPECTF--
51 files (will test only the first 4):
Extraction of file #1:
SUCCESS
Extraction of file #2:
Warning: RarEntry::extract(): ERAR_BAD_DATA in %s on line %d
FAILED
Extraction of file #3:
Warning: RarEntry::extract(): ERAR_BAD_DATA in %s on line %d
FAILED
Extraction of file #4:
Warning: RarEntry::extract(): ERAR_BAD_DATA in %s on line %d
FAILED
Done