Skip to content

Commit

Permalink
Improve test for bug77022
Browse files Browse the repository at this point in the history
  • Loading branch information
smalyshev committed Dec 2, 2018
1 parent 69f5e79 commit 2fba1e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/phar/tests/bug77022.phpt
@@ -1,7 +1,10 @@
--TEST--
Phar: Bug #77022: PharData always creates new files with mode 0666
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
<?php
if (!extension_loaded("phar")) die("skip");
if (defined("PHP_WINDOWS_VERSION_MAJOR")) die("skip not for Windows")
?>
--FILE--
<?php
umask(022);
Expand All @@ -11,6 +14,7 @@ $sFile = tempnam(__DIR__, 'test77022');
var_dump(decoct(stat($sFile)['mode']));

foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) {
clearstatcache();
$phar = new PharData(__DIR__ . '/test77022.' . $ext, null, null, $mode);
$phar->addFile($sFile, 'test-file-phar');
$phar->addFromString("test-from-string", 'test-file-phar');
Expand Down

1 comment on commit 2fba1e2

@staabm
Copy link
Contributor

@staabm staabm commented on 2fba1e2 Dec 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commit missing in master?

Please sign in to comment.