Skip to content
Snippets Groups Projects
Commit 7031fb42 authored by catch's avatar catch
Browse files

Issue #3487371 by spokje, dww: [random test failure] ImageStylesPathAndUrlTest

parent a39ed900
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ public function imageStyleFlush($style, $path = NULL): void { ...@@ -53,7 +53,7 @@ public function imageStyleFlush($style, $path = NULL): void {
*/ */
#[Hook('file_download')] #[Hook('file_download')]
public function fileDownload($uri): array { public function fileDownload($uri): array {
$default_uri = \Drupal::state()->get('image.test_file_download', FALSE); $default_uri = \Drupal::keyValue('image')->get('test_file_download', FALSE);
if ($default_uri == $uri) { if ($default_uri == $uri) {
return ['X-Image-Owned-By' => 'image_module_test']; return ['X-Image-Owned-By' => 'image_module_test'];
} }
......
...@@ -176,7 +176,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s ...@@ -176,7 +176,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::Rename); $original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::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().
\Drupal::state()->set('image.test_file_download', $original_uri); \Drupal::keyValue('image')->set('test_file_download', $original_uri);
$this->assertNotFalse($original_uri, 'Created the generated image file.'); $this->assertNotFalse($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.
...@@ -251,7 +251,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s ...@@ -251,7 +251,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
// Make sure that access is denied for existing style files if we do not // Make sure that access is denied for existing style files if we do not
// have access. // have access.
\Drupal::state()->delete('image.test_file_download'); \Drupal::keyValue('image')->delete('test_file_download');
$this->drupalGet($generate_url); $this->drupalGet($generate_url);
$this->assertSession()->statusCodeEquals(403); $this->assertSession()->statusCodeEquals(403);
...@@ -301,7 +301,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s ...@@ -301,7 +301,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::Rename); $original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::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().
\Drupal::state()->set('image.test_file_download', $original_uri); \Drupal::keyValue('image')->set('test_file_download', $original_uri);
// Suppress the security token in the URL, then get the URL of a file that // Suppress the security token in the URL, then get the URL of a file that
// has not been created and try to create it. Check that the security token // has not been created and try to create it. Check that the security token
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment