From: Pierre Joye Date: Tue, 4 Nov 2008 13:24:39 +0000 (+0000) Subject: - sync tests with pecl X-Git-Tag: BEFORE_NS_RULES_CHANGE~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7102449f76cd9b3acf7455322c9a84b19a92f478;p=php - sync tests with pecl --- diff --git a/ext/zip/tests/bug38943.inc b/ext/zip/tests/bug38943.inc new file mode 100644 index 0000000000..a6f45e8294 --- /dev/null +++ b/ext/zip/tests/bug38943.inc @@ -0,0 +1,16 @@ +testarray[] = 1; + var_dump($this->testarray); + } +} + +$z = new myZip; +$z->testp = "foobar"; +var_dump($z); + diff --git a/ext/zip/tests/bug38943_2.phpt b/ext/zip/tests/bug38943_2.phpt new file mode 100644 index 0000000000..1aaba37c12 --- /dev/null +++ b/ext/zip/tests/bug38943_2.phpt @@ -0,0 +1,38 @@ +--TEST-- +#38943, properties in extended class cannot be set (5.3) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +array(1) { + [0]=> + int(1) +} +object(myZip)#1 (%d) { + ["test":"myZip":private]=> + int(0) + ["testp"]=> + string(6) "foobar" + ["testarray":"myZip":private]=> + array(1) { + [0]=> + int(1) + } + ["status"]=> + int(0) + ["statusSys"]=> + int(0) + ["numFiles"]=> + int(0) + ["filename"]=> + string(0) "" + ["comment"]=> + string(0) "" +} diff --git a/ext/zip/tests/pecl12414.phpt b/ext/zip/tests/pecl12414.phpt new file mode 100644 index 0000000000..ab11d21a63 --- /dev/null +++ b/ext/zip/tests/pecl12414.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #12414 ( extracting files from damaged archives) +--SKIPIF-- + +--FILE-- +open($zipname); +if ($res === TRUE) { + $finfo=$za->statName($filename); + $file_size=$finfo['size']; + + if($file_size>0) { + $contents=$za->getFromName($filename); + + echo "ZIP contents size: " . strlen($contents) . "\n"; + if(strlen($contents)!=$file_size) { + echo "zip_readfile recorded data does not match unpacked size: " . $zipname . " : " . $filename; + } + } else { + $contents=false; + echo "zip_readfile could not open stream from zero length file " . $zipname . " : " .$filename; + } + + $za->close(); +} else { + echo "zip_readfile could not read from " . $zipname . " : " . $filename; +} + +?> +--DONE-- +--EXPECTF-- +ZIP contents size: %d +zip_readfile recorded data does not match unpacked size: %specl12414.zip : MYLOGOV2.GFX diff --git a/ext/zip/tests/pecl12414.zip b/ext/zip/tests/pecl12414.zip new file mode 100644 index 0000000000..6cbc60f607 Binary files /dev/null and b/ext/zip/tests/pecl12414.zip differ