Commit ae621fe6 authored by alexpott's avatar alexpott

Issue #2672888 by fago: BrowserTestBase fails when the webserver runs as another user

parent 6416f459
......@@ -1532,7 +1532,11 @@ public static function generatePermutations($parameters) {
* need to get deleted too.
*/
public static function filePreDeleteCallback($path) {
chmod($path, 0700);
// When the webserver runs with the same system user as the test runner, we
// can make read-only files writable again. If not, chmod will fail while
// the file deletion still works if file permissions have been configured
// correctly. Thus, we ignore any problems while running chmod.
@chmod($path, 0700);
}
/**
......
......@@ -557,10 +557,11 @@ protected function setUp() {
* The file path.
*/
public static function filePreDeleteCallback($path) {
$success = @chmod($path, 0700);
if (!$success) {
trigger_error("Can not make $path writable whilst cleaning up test directory. The webserver and phpunit are probably not being run by the same user.");
}
// When the webserver runs with the same system user as phpunit, we can
// make read-only files writable again. If not, chmod will fail while the
// file deletion still works if file permissions have been configured
// correctly. Thus, we ignore any problems while running chmod.
@chmod($path, 0700);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment