]> granicus.if.org Git - php/commitdiff
Improve test
authorAnatol Belski <ab@php.net>
Fri, 13 Jul 2018 18:13:51 +0000 (20:13 +0200)
committerAnatol Belski <ab@php.net>
Fri, 13 Jul 2018 18:13:51 +0000 (20:13 +0200)
Ensure the filename is non existent indeed.

ext/zip/tests/bug76524.phpt

index f28bfc13f23be6c52b4ab2d442b38d02c4772a86..e087015c3c2a98e2efd254800d3b1116b076848b 100644 (file)
@@ -7,7 +7,10 @@ if(!extension_loaded('zip')) die('skip');
 --FILE--
 <?php
 
-$filename = __DIR__ . '/nonexistent.zip';
+$i = 0;
+do {
+       $filename = __DIR__ . "/nonexistent" . ($i++) . ".zip";
+} while (file_exists($filename));
 
 $zip = new ZipArchive();
 $zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);