Skip to content

Commit

Permalink
minor #28529 [Yaml] Skip parser test with root user (lbassin)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nicolas-grekas committed Sep 24, 2018
2 parents 2fe425b + 3442979 commit 3ad2328
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Component/Yaml/Tests/ParserTest.php
Expand Up @@ -2099,6 +2099,10 @@ public function testParsingNotReadableFilesThrowsException()
$this->markTestSkipped('chmod is not supported on Windows');
}

if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}

$file = __DIR__.'/Fixtures/not_readable.yml';
chmod($file, 0200);

Expand Down

0 comments on commit 3ad2328

Please sign in to comment.