xref: /PHP-5.3/ext/zip/tests/bug14962.phpt (revision b9853c4f)
1--TEST--
2Bug #14962 (::extractTo second argument is not really optional)
3--SKIPIF--
4<?php
5/* $Id$ */
6if(!extension_loaded('zip')) die('skip');
7?>
8--FILE--
9<?php
10
11$dir = dirname(__FILE__);
12$file = '__tmp14962.txt';
13$fullpath = $dir . '/' . $file;
14$za = new ZipArchive;
15$za->open($dir . '/__14962.zip', ZIPARCHIVE::CREATE);
16$za->addFromString($file, '1234');
17$za->close();
18
19if (!is_file($dir . "/__14962.zip")) {
20	die('failed to create the archive');
21}
22$za = new ZipArchive;
23$za->open($dir . '/__14962.zip');
24$za->extractTo($dir, NULL);
25$za->close();
26
27if (is_file($fullpath)) {
28	unlink($fullpath);
29	echo "Ok";
30}
31unlink($dir . '/' . '__14962.zip');
32?>
33--EXPECT--
34Ok
35