8000 minor #28529 [Yaml] Skip parser test with root user (lbassin) · symfony/symfony@3ad2328 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ad2328

Browse files
minor #28529 [Yaml] Skip parser test with root user (lbassin)
This PR was squashed before being merged into the 3.4 branch (closes #28529). Discussion ---------- [Yaml] Skip parser test with root user | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28478 | License | MIT | Doc PR | - This PR fix a test failure in YAML Component when running from a php docker container. By defaut, root user is used to run phpunit. It means permission checking will fail (Root user is always allowed to read files) Commits ------- 3442979 [Yaml] Skip parser test with root user
2 parents 2fe425b + 3442979 commit 3ad2328

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Yaml/Tests/ParserTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,10 @@ public function testParsingNotReadableFilesThrowsException()
20992099
$this->markTestSkipped('chmod is not supported on Windows');
21002100
}
21012101

2102+
if (!getenv('USER') || 'root' === getenv('USER')) {
2103+
$this->markTestSkipped('This test will fail if run under superuser');
2104+
}
2105+
21022106
$file = __DIR__.'/Fixtures/not_readable.yml';
21032107
chmod($file, 0200);
21042108

0 commit comments

Comments
 (0)
0