diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php index a5ec856..1138f18 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php @@ -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. diff --git a/core/modules/image/tests/image_module_test.module b/core/modules/image/tests/image_module_test.module index 8a322fb..2cb078e 100644 --- a/core/modules/image/tests/image_module_test.module +++ b/core/modules/image/tests/image_module_test.module @@ -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'); } }