[Filesystem] Skip tests on readable file when run with root user

This commit is contained in:
Laurent Bassin 2018-09-24 10:04:37 +02:00
parent ed8dd86e20
commit ad500e74ec
No known key found for this signature in database
GPG Key ID: 94EC86BD307F4604
2 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,10 @@ class FilesystemTest extends FilesystemTestCase
$this->markTestSkipped('This test cannot run on Windows.');
}
if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
@ -124,6 +128,10 @@ class FilesystemTest extends FilesystemTestCase
$this->markTestSkipped('This test cannot run on Windows.');
}
if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';

View File

@ -49,6 +49,10 @@ class LockHandlerTest extends TestCase
$this->markTestSkipped('This test cannot run on Windows.');
}
if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}
$lockPath = sys_get_temp_dir().'/'.uniqid('', true);
$e = null;
$wrongMessage = null;