Commit 69a509f1 authored by catch's avatar catch
Browse files

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

(cherry picked from commit d5b6fbbd)
parent 4feb744c
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
use Drupal\image\ImageStyleInterface;

function image_module_test_file_download($uri) {
  $default_uri = \Drupal::state()->get('image.test_file_download', FALSE);
  $default_uri = \Drupal::keyValue('image')->get('test_file_download', FALSE);
  if ($default_uri == $uri) {
    return ['X-Image-Owned-By' => 'image_module_test'];
  }
+3 −3
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
    $original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::Rename);
    // Let the image_module_test module know about this file, so it can claim
    // 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.');

    // 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

      // Make sure that access is denied for existing style files if we do not
      // have access.
      \Drupal::state()->delete('image.test_file_download');
      \Drupal::keyValue('image')->delete('test_file_download');
      $this->drupalGet($generate_url);
      $this->assertSession()->statusCodeEquals(403);

@@ -301,7 +301,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
    $original_uri = $file_system->copy($file->uri, $scheme . '://', FileExists::Rename);
    // Let the image_module_test module know about this file, so it can claim
    // 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
    // has not been created and try to create it. Check that the security token