Issue #1824926 by vijaycs85: Convert image_module_test_file_download() variable to CMI system.

8.0.x
catch 2012-10-31 20:10:16 +00:00
parent 6b8d66b5b1
commit adf2518b9f
2 changed files with 3 additions and 2 deletions

View File

@ -106,7 +106,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
$original_uri = file_unmanaged_copy($file->uri, $scheme . '://', FILE_EXISTS_RENAME); $original_uri = file_unmanaged_copy($file->uri, $scheme . '://', FILE_EXISTS_RENAME);
// Let the image_module_test module know about this file, so it can claim // Let the image_module_test module know about this file, so it can claim
// ownership in hook_file_download(). // ownership in hook_file_download().
variable_set('image_module_test_file_download', $original_uri); state()->set('image.test_file_download', $original_uri);
$this->assertNotIdentical(FALSE, $original_uri, 'Created the generated image file.'); $this->assertNotIdentical(FALSE, $original_uri, 'Created the generated image file.');
// Get the URL of a file that has not been generated and try to create it. // Get the URL of a file that has not been generated and try to create it.

View File

@ -6,7 +6,8 @@
*/ */
function image_module_test_file_download($uri) { function image_module_test_file_download($uri) {
if (variable_get('image_module_test_file_download', FALSE) == $uri) { $default_uri = state()->get('image.test_file_download') ?: FALSE;
if ($default_uri == $uri) {
return array('X-Image-Owned-By' => 'image_module_test'); return array('X-Image-Owned-By' => 'image_module_test');
} }
} }