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
-------

34429797b3 [Yaml] Skip parser test with root user
This commit is contained in:
Nicolas Grekas 2018-09-24 10:15:51 +02:00
commit 3ad232835d

View File

@ -2099,6 +2099,10 @@ YAML;
$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);