diff options
Diffstat (limited to 'ext/zip/tests')
30 files changed, 0 insertions, 749 deletions
diff --git a/ext/zip/tests/001.phpt b/ext/zip/tests/001.phpt deleted file mode 100644 index 37dccc055e..0000000000 --- a/ext/zip/tests/001.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Check for zip presence ---SKIPIF-- -<?php if (!extension_loaded("zip")) print "skip"; ?> ---POST-- ---GET-- ---FILE-- -<?php -echo "zip extension is available"; -?> ---EXPECT-- -zip extension is available diff --git a/ext/zip/tests/binarynull.zip b/ext/zip/tests/binarynull.zip Binary files differdeleted file mode 100644 index 9da004efed..0000000000 --- a/ext/zip/tests/binarynull.zip +++ /dev/null diff --git a/ext/zip/tests/bug38943.phpt b/ext/zip/tests/bug38943.phpt deleted file mode 100644 index d7236e314b..0000000000 --- a/ext/zip/tests/bug38943.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -#38943, properties in extended class cannot be set ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -class myZip extends ZipArchive { - private $test = 0; - public $testp = 1; - private $testarray = array(); - - public function __construct() { - $this->testarray[] = 1; - var_dump($this->testarray); - } -} - -$z = new myZip; -$z->testp = "foobar"; -var_dump($z); -?> ---EXPECTF-- -array(1) { - [0]=> - int(1) -} -object(myZip)#1 (%d) { - ["test:private"]=> - int(0) - ["testp"]=> - string(6) "foobar" - ["testarray: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/bug38944.phpt b/ext/zip/tests/bug38944.phpt deleted file mode 100644 index ee12fad2b3..0000000000 --- a/ext/zip/tests/bug38944.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #38944 (newly created ZipArchive segfaults when accessing comment property) ---SKIPIF-- -<?php if (!extension_loaded("zip")) print "skip"; ?> ---FILE-- -<?php - -$arc_name = dirname(__FILE__)."/bug38944.zip"; -$foo = new ZipArchive; -$foo->open($arc_name, ZIPARCHIVE::CREATE);; - -var_dump($foo->status); -var_dump($foo->statusSys); -var_dump($foo->numFiles); -var_dump($foo->filename); -var_dump($foo->comment); - -var_dump($foo); - -echo "Done\n"; -?> ---EXPECTF-- -int(0) -int(0) -int(0) -string(0) "" -string(0) "" -object(ZipArchive)#%d (5) { - ["status"]=> - int(0) - ["statusSys"]=> - int(0) - ["numFiles"]=> - int(0) - ["filename"]=> - string(0) "" - ["comment"]=> - string(0) "" -} -Done diff --git a/ext/zip/tests/bug7214.phpt b/ext/zip/tests/bug7214.phpt deleted file mode 100644 index 7d7de5720a..0000000000 --- a/ext/zip/tests/bug7214.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -bug #7214, zip_entry_read() binary safe ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); - ?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/binarynull.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -$entry = zip_read($zip); -$contents = zip_entry_read($entry, zip_entry_filesize($entry)); -if (strlen($contents) == zip_entry_filesize($entry)) { - echo "Ok"; -} else { - echo "failed"; -} - -?> ---EXPECT-- -Ok
\ No newline at end of file diff --git a/ext/zip/tests/bug7658.odt b/ext/zip/tests/bug7658.odt Binary files differdeleted file mode 100644 index 527e09fefc..0000000000 --- a/ext/zip/tests/bug7658.odt +++ /dev/null diff --git a/ext/zip/tests/bug7658.phpt b/ext/zip/tests/bug7658.phpt deleted file mode 100644 index 3372b0d121..0000000000 --- a/ext/zip/tests/bug7658.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -bug #7658, modify archive with general bit flag 3 set ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$dirname = dirname(__FILE__) . '/'; -include $dirname . 'utils.inc'; -$file = $dirname . '__tmp_bug7658.odt'; -$zip = new ZipArchive(); -copy($dirname . 'bug7658.odt', $file); -if(!$zip->open($file)) { - echo 'failed'; -} - -dump_entries_name($zip); - -$zip->deleteName('content.xml'); -$zip->addFile($dirname . "bug7658.xml","content.xml"); -$zip->close(); -echo "\n"; -$zip->open($file); -dump_entries_name($zip); -@unlink($file); -?> ---EXPECT-- -0 mimetype -1 Configurations2/statusbar/ -2 Configurations2/accelerator/current.xml -3 Configurations2/floater/ -4 Configurations2/popupmenu/ -5 Configurations2/progressbar/ -6 Configurations2/menubar/ -7 Configurations2/toolbar/ -8 Configurations2/images/Bitmaps/ -9 content.xml -10 styles.xml -11 meta.xml -12 Thumbnails/thumbnail.png -13 settings.xml -14 META-INF/manifest.xml - -0 mimetype -1 Configurations2/statusbar/ -2 Configurations2/accelerator/current.xml -3 Configurations2/floater/ -4 Configurations2/popupmenu/ -5 Configurations2/progressbar/ -6 Configurations2/menubar/ -7 Configurations2/toolbar/ -8 Configurations2/images/Bitmaps/ -9 styles.xml -10 meta.xml -11 Thumbnails/thumbnail.png -12 settings.xml -13 META-INF/manifest.xml -14 content.xml diff --git a/ext/zip/tests/bug7658.xml b/ext/zip/tests/bug7658.xml deleted file mode 100644 index 98076f1984..0000000000 --- a/ext/zip/tests/bug7658.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"><office:scripts/><office:font-face-decls><style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/><style:font-face style:name="Arial Unicode MS" svg:font-family="'Arial Unicode MS'" style:font-pitch="variable"/><style:font-face style:name="Estrangelo Edessa" svg:font-family="'Estrangelo Edessa'" style:font-pitch="variable"/><style:font-face style:name="MS Mincho" svg:font-family="'MS Mincho'" style:font-pitch="variable"/><style:font-face style:name="Miriam CLM" svg:font-family="'Miriam CLM'" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/><style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="Tabella1" style:family="table"><style:table-properties style:width="6.6924in" table:align="margins"/></style:style><style:style style:name="Tabella1.A" style:family="table-column"><style:table-column-properties style:column-width="4.8556in" style:rel-column-width="47546*"/></style:style><style:style style:name="Tabella1.B" style:family="table-column"><style:table-column-properties style:column-width="1.8368in" style:rel-column-width="17989*"/></style:style><style:style style:name="Tabella1.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="0.0007in solid #000000" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.B1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.A2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.B2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="0.0007in solid #000000" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2" style:family="table"><style:table-properties style:width="6.6924in" table:align="margins"/></style:style><style:style style:name="Tabella2.A" style:family="table-column"><style:table-column-properties style:column-width="2.584in" style:rel-column-width="25303*"/></style:style><style:style style:name="Tabella2.C" style:family="table-column"><style:table-column-properties style:column-width="1.5243in" style:rel-column-width="14929*"/></style:style><style:style style:name="Tabella2.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="0.0007in solid #000000" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.C1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.A2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.C2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="0.0007in solid #000000" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Heading"><style:text-properties style:font-name="Estrangelo Edessa" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style><style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table_20_Heading"><style:paragraph-properties fo:padding="0.0193in" fo:border="0.0008in solid #000000" style:shadow="none"/><style:text-properties style:font-name="Estrangelo Edessa" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style><style:style style:name="P3" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties fo:color="#ff0000" style:font-name="Miriam CLM" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style></office:automatic-styles><office:body><office:text><office:forms form:automatic-focus="false" form:apply-design-mode="false"/><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard"/><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Other text Silvio Berlusconi, le ricordo che ha in prestito i seguenti libri</text:p><text:p text:style-name="Standard"/><table:table table:name="Tabella1" table:style-name="Tabella1"><table:table-column table:style-name="Tabella1.A"/><table:table-column table:style-name="Tabella1.B"/><table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella1.A1" office:value-type="string"><text:p text:style-name="P1">Titolo</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B1" office:value-type="string"><text:p text:style-name="P1">Inventario</text:p></table:table-cell></table:table-row></table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Codice Da Vinci</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">112345678</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Lo Zen e il tiro con l'arco</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020304</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Lo Zen e l'arte della manutenzione della motocicletta</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020305</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">101 Storie Zen</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020306</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Antani di Blinda come fosse di Cappotto</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">4112345</text:p></table:table-cell></table:table-row></table:table><text:p text:style-name="Standard"/><text:p text:style-name="Standard">peraltro, sottolineiamo la perentorietà della restituzione anche dei vieppiù interessanti testi:</text:p><text:p text:style-name="Standard"/><table:table table:name="Tabella2" table:style-name="Tabella2"><table:table-column table:style-name="Tabella2.A" table:number-columns-repeated="2"/><table:table-column table:style-name="Tabella2.C"/><table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella2.A1" office:value-type="string"><text:p text:style-name="P2">Titolo</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A1" office:value-type="string"><text:p text:style-name="P2">Autore</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C1" office:value-type="string"><text:p text:style-name="P2">Inventario</text:p></table:table-cell></table:table-row></table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Angeli e Demoni</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Dan Brown</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">12131415</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La versione di Barney</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Mordecai Richler</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">2010322</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Manuale PHP</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Varii</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">32413543</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La prematurata supercazzola negli anni a venire</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Ugo Tognazzi</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">31213243</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La sbiriguda in vicesindaco</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Ugo Tognazzi</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1324354654</text:p></table:table-cell></table:table-row></table:table><text:p text:style-name="Standard"/><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Gentili saluti, la sua biblioteca</text:p></office:text></office:body></office:document-content> diff --git a/ext/zip/tests/bug8009.phpt b/ext/zip/tests/bug8009.phpt deleted file mode 100644 index 90ab765bfa..0000000000 --- a/ext/zip/tests/bug8009.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -bug #8009, cannot add again same entry to an archive ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$thisdir = dirname(__FILE__); -$src = $thisdir . "/bug8009.zip"; -$filename = $thisdir . "/tmp8009.zip"; -copy($src, $filename); - -$zip = new ZipArchive(); - -if (!$zip->open($filename)) { - exit("cannot open $filename\n"); -} -$zip->addFromString("2.txt", "=)"); -$zip->close(); -unlink($filename); -echo "status: " . $zip->status . "\n"; -echo "\n"; - ---EXPECT-- -status: 0 diff --git a/ext/zip/tests/bug8009.zip b/ext/zip/tests/bug8009.zip Binary files differdeleted file mode 100644 index 45bedcbe88..0000000000 --- a/ext/zip/tests/bug8009.zip +++ /dev/null diff --git a/ext/zip/tests/bug8700.phpt b/ext/zip/tests/bug8700.phpt deleted file mode 100644 index 5e7df4560b..0000000000 --- a/ext/zip/tests/bug8700.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -bug #8700, getFromIndex(0) fails ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$thisdir = dirname(__FILE__); -$filename = $thisdir . "/bug8009.zip"; - -$zip = new ZipArchive(); - -if ($zip->open($filename) === FALSE) { - exit("cannot open $filename\n"); -} -$contents_from_idx = $zip->getFromIndex(0); -$contents_from_name = $zip->getFromName('1.txt'); -if ($contents_from_idx != $contents_from_name) { - echo "failed:"; - var_dump($content_from_idx, $content_from_name); -} - -$zip->close(); -echo "status: " . $zip->status . "\n"; -echo "\n"; - ---EXPECT-- -status: 0 diff --git a/ext/zip/tests/oo_addfile.phpt b/ext/zip/tests/oo_addfile.phpt deleted file mode 100644 index ab79780999..0000000000 --- a/ext/zip/tests/oo_addfile.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ziparchive::addFile() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php - -$dirname = dirname(__FILE__) . '/'; -include $dirname . 'utils.inc'; -$file = $dirname . '__tmp_oo_addfile.zip'; - -copy($dirname . 'test.zip', $file); - -$zip = new ZipArchive; -if (!$zip->open($file)) { - exit('failed'); -} -if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) { - echo "failed\n"; -} -if ($zip->status == ZIPARCHIVE::ER_OK) { - dump_entries_name($zip); - $zip->close(); -} else { - echo "failed\n"; -} -@unlink($file); -?> ---EXPECTF-- -0 bar -1 foobar/ -2 foobar/baz -3 entry1.txt -4 test.php diff --git a/ext/zip/tests/oo_close.phpt b/ext/zip/tests/oo_close.phpt deleted file mode 100644 index ea67dcddfc..0000000000 --- a/ext/zip/tests/oo_close.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -zip::close() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php - -$dirname = dirname(__FILE__) . '/'; -$zip = new ZipArchive; -if (!$zip->open($dirname . 'test.zip')) { - exit('failed'); -} - -if ($zip->status == ZIPARCHIVE::ER_OK) { - $zip->close(); - echo "ok\n"; -} else { - echo "failed\n"; -} -?> ---EXPECTF-- -ok diff --git a/ext/zip/tests/oo_delete.phpt b/ext/zip/tests/oo_delete.phpt deleted file mode 100644 index 176cda44dc..0000000000 --- a/ext/zip/tests/oo_delete.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Delete entries ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$dirname = dirname(__FILE__) . '/'; -$file = $dirname . '__tmp_oo_delete.zip'; -if (file_exists($file)) { - unlink($file); -} - -$zip = new ZipArchive; -if (!$zip->open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2.txt', 'entry #2'); - -if ($zip->status == ZIPARCHIVE::ER_OK) { - $zip->close(); - echo "ok\n"; -} else { - var_dump($zip); - echo "failed\n"; -} - -if (!$zip->open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -if ($zip->deleteIndex(0)) { - echo "ok\n"; -} - -if ($zip->deleteName('entry2.txt')) { - echo "ok\n"; -} else { - echo "failed 3\n"; -} - -if ($zip->deleteName('dir/entry2.txt')) { - echo "ok\n"; -} else { - echo "failed 3\n"; -} - -if (!$zip->deleteIndex(123)) { - echo "ok\n"; -} else { - print_r($zip); - echo "failed\n"; -} - - -$sb = $zip->statIndex(0); -var_dump($sb); -$sb = $zip->statIndex(1); -var_dump($sb); -$sb = $zip->statIndex(2); -var_dump($sb); -@unlink($file); -?> ---EXPECTF-- -ok -ok -ok -ok -ok -bool(false) -bool(false) -bool(false) diff --git a/ext/zip/tests/oo_ext_zip.phpt b/ext/zip/tests/oo_ext_zip.phpt deleted file mode 100644 index 739a671e0b..0000000000 --- a/ext/zip/tests/oo_ext_zip.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Extending Zip class and array property ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -class myZip extends ZipArchive { - private $test = 0; - public $testp = 1; - private $testarray = array(); - - public function __construct() { - $this->testarray[] = 1; - var_dump($this->testarray); - } -} - -$z = new myZip; -?> ---EXPECTF-- -array(1) { - [0]=> - int(1) -} diff --git a/ext/zip/tests/oo_namelocate.phpt b/ext/zip/tests/oo_namelocate.phpt deleted file mode 100644 index bbe7ec55d9..0000000000 --- a/ext/zip/tests/oo_namelocate.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Locate entries by name ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$dirname = dirname(__FILE__) . '/'; -include $dirname . 'utils.inc'; -$file = $dirname . '__tmp_oo_rename.zip'; - -@unlink($file); - -$zip = new ZipArchive; -if (!$zip->open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2d.txt', 'entry #2'); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - echo "failed to write zip\n"; -} -$zip->close(); - -if (!$zip->open($file)) { - exit('failed'); -} - - -var_dump($zip->locateName('entry1.txt')); -var_dump($zip->locateName('eNtry2.txt')); -var_dump($zip->locateName('eNtry2.txt', ZIPARCHIVE::FL_NOCASE)); -var_dump($zip->locateName('enTRy2d.txt', ZIPARCHIVE::FL_NOCASE|ZIPARCHIVE::FL_NODIR)); -$zip->close(); - -?> ---EXPECTF-- -int(0) -bool(false) -int(1) -int(2) diff --git a/ext/zip/tests/oo_open.phpt b/ext/zip/tests/oo_open.phpt deleted file mode 100644 index 0760db34c4..0000000000 --- a/ext/zip/tests/oo_open.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -zip::open() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php - -$dirname = dirname(__FILE__) . '/'; -$zip = new ZipArchive; -$r = $zip->open($dirname . 'nofile'); -if ($r !== TRUE) { - echo "ER_OPEN: ok\n"; -} else { - echo "ER_OPEN: FAILED\n"; -} - -$r = $zip->open($dirname . 'nofile', ZIPARCHIVE::CREATE); -if (!$r) { - echo "create: failed\n"; -} else { - echo "create: ok\n"; -} -@unlink($dirname . 'nofile'); - -$zip = new ZipArchive; -$zip->open(''); - -if (!$zip->open($dirname . 'test.zip')) { - exit("failed 1\n"); -} - -if ($zip->status == ZIPARCHIVE::ER_OK) { - echo "OK\n"; -} else { - echo "failed\n"; -} -?> ---EXPECTF-- -ER_OPEN: ok -create: ok - -Warning: ZipArchive::open(): Empty string as source in %s on line %d -OK diff --git a/ext/zip/tests/oo_rename.phpt b/ext/zip/tests/oo_rename.phpt deleted file mode 100644 index 98489ae256..0000000000 --- a/ext/zip/tests/oo_rename.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Rename entries ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$dirname = dirname(__FILE__) . '/'; -include $dirname . 'utils.inc'; -$file = $dirname . '__tmp_oo_rename.zip'; - -@unlink($file); - -$zip = new ZipArchive; -if (!$zip->open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2.txt', 'entry #2'); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - var_dump($zip); - echo "failed\n"; -} - -$zip->close(); - -if (!$zip->open($file)) { - exit('failed'); -} - -dump_entries_name($zip); -echo "\n"; - -if (!$zip->renameIndex(0, 'ren_entry1.txt')) { - echo "failed index 0\n"; -} - -if (!$zip->renameName('dir/entry2.txt', 'dir3/ren_entry2.txt')) { - echo "failed name dir/entry2.txt\n"; -} -dump_entries_name($zip); -$zip->close(); - -@unlink($file); -?> ---EXPECTF-- -0 entry1.txt -1 entry2.txt -2 dir/entry2.txt - -0 ren_entry1.txt -1 entry2.txt -2 dir3/ren_entry2.txt diff --git a/ext/zip/tests/test.zip b/ext/zip/tests/test.zip Binary files differdeleted file mode 100644 index 35bd5eecdf..0000000000 --- a/ext/zip/tests/test.zip +++ /dev/null diff --git a/ext/zip/tests/test_procedural.zip b/ext/zip/tests/test_procedural.zip Binary files differdeleted file mode 100644 index 6b98694803..0000000000 --- a/ext/zip/tests/test_procedural.zip +++ /dev/null diff --git a/ext/zip/tests/utils.inc b/ext/zip/tests/utils.inc deleted file mode 100644 index 41a2791266..0000000000 --- a/ext/zip/tests/utils.inc +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/* $Id$ */ -function dump_entries_name($z) { - for($i=0; $i<$z->numFiles; $i++) { - $sb = $z->statIndex($i); - echo $i . ' ' . $sb['name'] . "\n"; - } -} diff --git a/ext/zip/tests/zip_close.phpt b/ext/zip/tests/zip_close.phpt deleted file mode 100644 index 7f9d09ae36..0000000000 --- a/ext/zip/tests/zip_close.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zip_close() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -zip_close($zip); -echo "OK"; - -?> ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_entry_compressedsize.phpt b/ext/zip/tests/zip_entry_compressedsize.phpt deleted file mode 100644 index fefa6e5977..0000000000 --- a/ext/zip/tests/zip_entry_compressedsize.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_compressedsize() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -while ($entry = zip_read($zip)) { - echo zip_entry_compressedsize($entry)."\n"; -} -zip_close($zip); - -?> ---EXPECT-- -5 -4 -0 -24 diff --git a/ext/zip/tests/zip_entry_compressionmethod.phpt b/ext/zip/tests/zip_entry_compressionmethod.phpt deleted file mode 100644 index cabdbb797f..0000000000 --- a/ext/zip/tests/zip_entry_compressionmethod.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -zip_entry_compressionmethod() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -while ($entry = zip_read($zip)) { - echo zip_entry_compressionmethod($entry)."\n"; -} -zip_close($zip); - -?> ---EXPECT-- -stored -stored -stored -deflated - diff --git a/ext/zip/tests/zip_entry_filesize.phpt b/ext/zip/tests/zip_entry_filesize.phpt deleted file mode 100644 index b8d8820b64..0000000000 --- a/ext/zip/tests/zip_entry_filesize.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_filesize() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -while ($entry = zip_read($zip)) { - echo zip_entry_filesize($entry)."\n"; -} -zip_close($zip); - -?> ---EXPECT-- -5 -4 -0 -27 diff --git a/ext/zip/tests/zip_entry_name.phpt b/ext/zip/tests/zip_entry_name.phpt deleted file mode 100644 index 1916e25dac..0000000000 --- a/ext/zip/tests/zip_entry_name.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_name() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -while ($entry = zip_read($zip)) { - echo zip_entry_name($entry)."\n"; -} -zip_close($zip); - -?> ---EXPECT-- -foo -bar -foobar/ -foobar/baz diff --git a/ext/zip/tests/zip_entry_open.phpt b/ext/zip/tests/zip_entry_open.phpt deleted file mode 100644 index b79e39108f..0000000000 --- a/ext/zip/tests/zip_entry_open.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zip_entry_open() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -$entry = zip_read($zip); -echo zip_entry_open($zip, $entry, "r") ? "OK" : "Failure"; -zip_close($zip); - -?> ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_entry_read.phpt b/ext/zip/tests/zip_entry_read.phpt deleted file mode 100644 index 94dde59cbd..0000000000 --- a/ext/zip/tests/zip_entry_read.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -zip_entry_read() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -$entry = zip_read($zip); -if (!zip_entry_open($zip, $entry, "r")) die("Failure"); -echo zip_entry_read($entry); -zip_close($zip); - -?> ---EXPECT-- -foo diff --git a/ext/zip/tests/zip_open.phpt b/ext/zip/tests/zip_open.phpt deleted file mode 100644 index 91474bc6fd..0000000000 --- a/ext/zip/tests/zip_open.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -zip_open() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); - -echo is_resource($zip) ? "OK" : "Failure"; - -?> ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_read.phpt b/ext/zip/tests/zip_read.phpt deleted file mode 100644 index 5cadb2d1ef..0000000000 --- a/ext/zip/tests/zip_read.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -zip_read() function ---SKIPIF-- -<?php -/* $Id$ */ -if(!extension_loaded('zip')) die('skip'); -?> ---FILE-- -<?php -$zip = zip_open(dirname(__FILE__)."/test_procedural.zip"); -if (!is_resource($zip)) die("Failure"); -$entries = 0; -while ($entry = zip_read($zip)) { - $entries++; -} -zip_close($zip); -echo "$entries entries"; - -?> ---EXPECT-- -4 entries |