Issue #2672888 by fago: BrowserTestBase fails when the webserver runs as another user
parent
6416f45978
commit
ae621fe689
|
@ -1532,7 +1532,11 @@ abstract class TestBase {
|
|||
* 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 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue