- πΊπΈUnited States dww
I didn't read the parent issue. I'm not sure I totally understand everything here, so take some of these review points with a dash of salt. π Mostly nits, but a few points of substance:
-
+++ b/core/modules/image/tests/modules/image_module_test/image_module_test.module @@ -12,6 +12,10 @@ function image_module_test_file_download($uri) { + if ($header_uri == $uri) {
Should be
===
-
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + * Test that multiple same headers does not create a PHP notice.
This doesn't follow our standards, and doesn't make a ton of English sense. How about:
"Tests that a page with duplicate headers does not create a PHP notice."
? I'm not totally following what we're testing here. π
-
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + public function testImageContentTypeHeaders() {
a. wants a
: void
return type.b. Is that really what we're testing here? The name doesn't seem to match the comment above (if I understand the comment above π ).
-
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + $files = $this->drupalGetTestFiles('image'); + $file = array_shift($files); ... + $this->assertSession()->responseHeaderEquals('Content-Type', 'image/png');
Does anything ensure that the first
$file
we get fromdrupalGetTestFiles()
is definitely going to be a .png? If that ever changes, isn't this test going to silently stop proving anything? -
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + $file_system = \Drupal::service('file_system');
Since we only use this once, do we need the local variable for it?
-
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + // Copy the test file to private folder.
... to the private folder
-
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -326,4 +326,23 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s + // Clean up. + \Drupal::state()->delete('image.test_invalid_headers');
Do we also want/need to remove the file from the private folder here?
-
- Assigned to RISHABH VISHWAKARMA
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 4:25am 14 March 2023 Strangely running PHPCBF is making the patch fail. Adding the patch again.
- Status changed to Needs work
almost 2 years ago 11:43pm 14 March 2023 - πΊπΈUnited States smustgrave
Thanks for the interest
Shouldn't be moved to review until all the points are addressed. But helps that some of them have been!