1
0
mirror of https://github.com/danog/file.git synced 2024-11-26 11:54:54 +01:00

Account for umask in file permission assertion

This commit is contained in:
Niklas Keller 2017-06-18 20:38:03 +02:00
parent 5e1651468b
commit 75d2a77951
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/composer.lock /composer.lock
/vendor /vendor
/.php_cs.cache /.php_cs.cache
/build

View File

@ -233,9 +233,9 @@ abstract class DriverTest extends TestCase {
// test for 0, because previous array_filter made that not work // test for 0, because previous array_filter made that not work
$dir = "{$fixtureDir}/newdir/with/recursive/creation/0/1/2"; $dir = "{$fixtureDir}/newdir/with/recursive/creation/0/1/2";
yield File\mkdir($dir, 0764, true); // the umask is 022 by default yield File\mkdir($dir, 0764, true);
$stat = yield File\stat($dir); $stat = yield File\stat($dir);
$this->assertSame(0764, $stat["mode"] & 0777); $this->assertSame(0764 & (~\umask()), $stat["mode"] & 0777);
}); });
} }