xref: /php-src/ext/zip/tests/zip_open_error.phpt (revision 5853cdb7)
1--TEST--
2zip_open() error conditions
3--CREDITS--
4Birgitte Kvarme <bitta@redpill-linpro.com>
5#PHPTestFest2009 Norway 2009-06-09 \o/
6--EXTENSIONS--
7zip
8--FILE--
9<?php
10echo "Test case 1:";
11try {
12    $zip = zip_open("");
13} catch (\ValueError $e) {
14    echo $e->getMessage() . \PHP_EOL;
15}
16
17echo "Test case 2:\n";
18$zip = zip_open("/non_exisitng_directory/test_procedural.zip");
19echo is_resource($zip) ? "OK" : "Failure";
20?>
21--EXPECTF--
22Test case 1:
23Deprecated: Function zip_open() is deprecated since 8.0, use ZipArchive::open() instead in %s on line %d
24zip_open(): Argument #1 ($filename) must not be empty
25Test case 2:
26
27Deprecated: Function zip_open() is deprecated since 8.0, use ZipArchive::open() instead in %s on line %d
28Failure
29