Issue #2302799 by alexpott, penyaskito: Fixed InstallerTestBase tests can not be run locally.

8.0.x
Nathaniel Catchpole 2014-10-13 13:06:41 +01:00
parent e14d0a7ce4
commit dcd5ea18c1
2 changed files with 6 additions and 5 deletions

View File

@ -1032,14 +1032,14 @@ function file_delete_multiple(array $fids) {
* @see file_unmanaged_delete_recursive()
*/
function file_unmanaged_delete($path) {
if (is_file($path)) {
return drupal_unlink($path);
}
$logger = \Drupal::logger('file');
if (is_dir($path)) {
$logger->error('%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path));
return FALSE;
}
if (is_file($path)) {
return drupal_unlink($path);
}
// Return TRUE for non-existent file, but log that nothing was actually
// deleted, as the current state is the intended result.
if (!file_exists($path)) {

View File

@ -2037,8 +2037,9 @@ function install_check_requirements($install_state) {
// common configuration on shared hosting, and there is nothing Drupal
// can do to prevent it. In this situation, having $file also owned by
// the webserver does not introduce any additional security risk, so we
// keep the file in place.
if (fileowner($default_file) === fileowner($file)) {
// keep the file in place. Additionally, this situation also occurs when
// the test runner is being run be different user than the webserver.
if (fileowner($default_file) === fileowner($file) || DRUPAL_TEST_IN_CHILD_SITE) {
$readable = drupal_verify_install_file($file, FILE_READABLE);
$writable = drupal_verify_install_file($file, FILE_WRITABLE);
$exists = TRUE;