Commit dcd5ea18 authored by catch's avatar catch

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

parent e14d0a7c
...@@ -1032,14 +1032,14 @@ function file_delete_multiple(array $fids) { ...@@ -1032,14 +1032,14 @@ function file_delete_multiple(array $fids) {
* @see file_unmanaged_delete_recursive() * @see file_unmanaged_delete_recursive()
*/ */
function file_unmanaged_delete($path) { function file_unmanaged_delete($path) {
if (is_file($path)) {
return drupal_unlink($path);
}
$logger = \Drupal::logger('file'); $logger = \Drupal::logger('file');
if (is_dir($path)) { if (is_dir($path)) {
$logger->error('%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path)); $logger->error('%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path));
return FALSE; return FALSE;
} }
if (is_file($path)) {
return drupal_unlink($path);
}
// Return TRUE for non-existent file, but log that nothing was actually // Return TRUE for non-existent file, but log that nothing was actually
// deleted, as the current state is the intended result. // deleted, as the current state is the intended result.
if (!file_exists($path)) { if (!file_exists($path)) {
......
...@@ -2037,8 +2037,9 @@ function install_check_requirements($install_state) { ...@@ -2037,8 +2037,9 @@ function install_check_requirements($install_state) {
// common configuration on shared hosting, and there is nothing Drupal // common configuration on shared hosting, and there is nothing Drupal
// can do to prevent it. In this situation, having $file also owned by // can do to prevent it. In this situation, having $file also owned by
// the webserver does not introduce any additional security risk, so we // the webserver does not introduce any additional security risk, so we
// keep the file in place. // keep the file in place. Additionally, this situation also occurs when
if (fileowner($default_file) === fileowner($file)) { // 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); $readable = drupal_verify_install_file($file, FILE_READABLE);
$writable = drupal_verify_install_file($file, FILE_WRITABLE); $writable = drupal_verify_install_file($file, FILE_WRITABLE);
$exists = TRUE; $exists = TRUE;
......
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