Skip to content

Commit

Permalink
Fix bug40228*.phpt conflict
Browse files Browse the repository at this point in the history
Both tests use the same directory structure; we avoid that by
extracting to separate subdirectories.

Closes GH-7831.
  • Loading branch information
cmb69 committed Dec 26, 2021
1 parent 5005445 commit 7f0a1e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ext/zip/tests/bug40228-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Bug #40228 (extractTo does not create recursive empty path)
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
$dest = __DIR__;
$arc_name = $dest . "/bug40228私はガラスを食べられます.zip";
$dest = __DIR__ . "/bug40228-mb";
$arc_name = __DIR__ . "/bug40228私はガラスを食べられます.zip";
$zip = new ZipArchive;
$zip->open($arc_name, ZIPARCHIVE::CREATE);
$zip->extractTo($dest);
if (is_dir($dest . '/test/empty')) {
echo "Ok\n";
rmdir($dest . '/test/empty');
rmdir($dest . '/test');
rmdir($dest);
} else {
echo "Failed.\n";
}
Expand Down
5 changes: 3 additions & 2 deletions ext/zip/tests/bug40228.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Bug #40228 (extractTo does not create recursive empty path)
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
$dest = __DIR__;
$arc_name = $dest . "/bug40228.zip";
$dest = __DIR__ . "/bug40228";
$arc_name = __DIR__ . "/bug40228.zip";
$zip = new ZipArchive;
$zip->open($arc_name, ZIPARCHIVE::CREATE);
$zip->extractTo($dest);
if (is_dir($dest . '/test/empty')) {
echo "Ok\n";
rmdir($dest . '/test/empty');
rmdir($dest . '/test');
rmdir($dest);
} else {
echo "Failed.\n";
}
Expand Down

0 comments on commit 7f0a1e2

Please sign in to comment.