Commit adf2518b authored by catch's avatar catch
Browse files

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

parent 6b8d66b5
......@@ -106,7 +106,7 @@ function _testImageStyleUrlAndPath($scheme, $clean_url = TRUE) {
$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
// 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.');
// Get the URL of a file that has not been generated and try to create it.
......
......@@ -6,7 +6,8 @@
*/
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');
}
}
......
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