Update Drupal 7 dependencies

This commit is contained in:
Mauricio Dinarte 2025-06-03 10:37:00 -06:00 committed by Janez Urevc
parent 7d902ba1ef
commit 13df912654
391 changed files with 2900 additions and 1502 deletions

View file

@ -2616,11 +2616,16 @@ class FileDownloadTest extends FileTestCase {
$url = file_create_url($file->uri);
// Set file_test access header to allow the download.
file_test_reset();
file_test_set_return('download', array('x-foo' => 'Bar'));
$this->drupalGet($url);
$headers = $this->drupalGetHeaders();
$this->assertEqual($headers['x-foo'], 'Bar', 'Found header set by file_test module on private download.');
$this->assertResponse(200, 'Correctly allowed access to a file when file_test provides headers.');
// Ensure hook_file_download is fired correctly.
$hooks_results = file_test_get_all_calls();
$file_uri = !empty($hooks_results['download']) ? reset($hooks_results['download'][0]) : '';
$this->assertEqual($file->uri, $file_uri);
// Test that the file transferred correctly.
$this->assertEqual($contents, $this->content, 'Contents of the file are correct.');
@ -2631,9 +2636,23 @@ class FileDownloadTest extends FileTestCase {
$this->assertResponse(403, 'Correctly denied access to a file when file_test sets the header to -1.');
// Try non-existent file.
file_test_reset();
$url = file_create_url('private://' . $this->randomName());
$this->drupalHead($url);
$this->assertResponse(404, 'Correctly returned 404 response for a non-existent file.');
// Assert that hook_file_download is not called.
$hooks_results = file_test_get_all_calls();
$hook_download_results = isset($hooks_results['download']) ? $hooks_results['download'] : NULL;
$this->assertEqual(array(), $hook_download_results);
// Try requesting the private file url without a file specified.
file_test_reset();
$this->drupalGet('system/files');
$this->assertResponse(404, 'Correctly returned 404 response for a private file url without a file specified.');
// Assert that hook_file_download is not called.
$hooks_results = file_test_get_all_calls();
$hook_download_results = isset($hooks_results['download']) ? $hooks_results['download'] : NULL;
$this->assertEqual(array(), $hook_download_results);
}
/**