diff --git a/composer.json b/composer.json index 026491b..3c7c8b1 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "scripts": { "cs-fix": "php-cs-fixer fix", "rector": "rector", - "test": "phpunit --testdox --no-interaction", + "test": "phpunit", "test-watch": "phpunit-watcher watch" } } diff --git a/tests/ItemsStorage/CreateNestedDirectory/CreateNestedDirectoryTest.php b/tests/ItemsStorage/CreateNestedDirectory/CreateNestedDirectoryTest.php index 474fc52..de14329 100644 --- a/tests/ItemsStorage/CreateNestedDirectory/CreateNestedDirectoryTest.php +++ b/tests/ItemsStorage/CreateNestedDirectory/CreateNestedDirectoryTest.php @@ -55,9 +55,6 @@ public function testRestoreErrorHandler(): void assertSame($errorHandler, $currentErrorHandler); } - /** - * @requires OS Linux - */ public function testDirectoryPermission(): void { $directory = self::RUNTIME_DIRECTORY . '/test/create/nested/directory-permissions'; @@ -65,6 +62,7 @@ public function testDirectoryPermission(): void $storage = new ItemsStorage($directory . '/items.php'); $storage->add(new Permission('createPost')); - $this->assertSame(0755, TestHelper::getDirectoryPermissions($directory)); + $this->assertTrue(is_writable($directory)); + $this->assertTrue(is_readable($directory)); } } diff --git a/tests/Support/TestHelper.php b/tests/Support/TestHelper.php index 076c7e1..47566e6 100644 --- a/tests/Support/TestHelper.php +++ b/tests/Support/TestHelper.php @@ -4,8 +4,6 @@ namespace Yiisoft\Rbac\Php\Tests\Support; -use function sprintf; - final class TestHelper { private function __construct() {} @@ -16,9 +14,4 @@ public static function getCurrentErrorHandler(): ?callable restore_error_handler(); return $currentHandler; } - - public static function getDirectoryPermissions(string $path): int - { - return octdec(substr(sprintf('%o', fileperms($path)), -4)); - } }