From 75d2a77951cefa66b73d4a3012ed29dcba64beb0 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 18 Jun 2017 20:38:03 +0200 Subject: [PATCH] Account for umask in file permission assertion --- .gitignore | 3 ++- test/DriverTest.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8a3d477..b6e48c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /composer.lock /vendor -/.php_cs.cache \ No newline at end of file +/.php_cs.cache +/build \ No newline at end of file diff --git a/test/DriverTest.php b/test/DriverTest.php index fb77486..9a9fb01 100644 --- a/test/DriverTest.php +++ b/test/DriverTest.php @@ -233,9 +233,9 @@ abstract class DriverTest extends TestCase { // test for 0, because previous array_filter made that not work $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); - $this->assertSame(0764, $stat["mode"] & 0777); + $this->assertSame(0764 & (~\umask()), $stat["mode"] & 0777); }); }