File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / zip / tests / bug64342_1.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:11 2013 UTC (11 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #64342 ZipArchive::addFile() has to check file existence (variation 2)
--SKIPIF--
<?php
/* $Id: bug64342_1.phpt,v 1.1.1.1 2013/07/22 01:32:11 misho Exp $ */
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 . 'cant_find_me.txt', 'test.php')) {
	echo "failed\n";
}
if ($zip->status == ZIPARCHIVE::ER_OK) {
	dump_entries_name($zip);
	$zip->close();
} else {
	echo "failed\n";
}
@unlink($file);
?>
--EXPECTF--
failed
0 bar
1 foobar/
2 foobar/baz
3 entry1.txt

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>