// Make sure that language prefix is never added to the image style URL.
if ($langcode) { $this->
assertStringNotContainsString("/
$langcode/",
$generate_url, 'Langcode was not found in the image style URL.'
);
} // Ensure that the tests still pass when the file is generated by accessing
// a poorly constructed (but still valid) file URL that has an extra slash
// in it.
if ($extra_slash) { $modified_uri =
str_replace('://', ':///',
$original_uri);
$this->
assertNotEquals($original_uri,
$modified_uri, 'An extra slash was added to the generated file URI.'
);
$generate_url =
$this->style->
buildUrl($modified_uri,
$clean_url);
} if (!
$clean_url) { $this->
assertStringContainsString('index.php/',
$generate_url, 'When using non-clean URLS, the system path contains the script name.'
);
} // Add some extra chars to the token.
$this->
drupalGet(str_replace(IMAGE_DERIVATIVE_TOKEN . '=', IMAGE_DERIVATIVE_TOKEN . '=Zo',
$generate_url));
$this->
assertSession()->
statusCodeEquals(404
);
// Change the parameter name so the token is missing.
$this->
drupalGet(str_replace(IMAGE_DERIVATIVE_TOKEN . '=', 'wrongparam=',
$generate_url));
$this->
assertSession()->
statusCodeEquals(404
);