Skip to content

Commit dc12f5a

Browse files
tijmenbruggemanrkoopmans
authored andcommitted
type and incorrect srcset
1 parent 0f6a8a8 commit dc12f5a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/unit/TinyPictureTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,14 @@ public function test_largest_width_is_present_so_include_sourceset()
315315
* Note that if any resource in a srcset is described with a "w" descriptor, all resources within that srcset must also be described with "w" descriptors, and the image element's src is not considered a candidate.
316316
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset#value
317317
*/
318-
public function test_mixed_descriptors_in_soruce()
318+
public function test_mixed_descriptors_in_source()
319319
{
320320
$this->wp->createImage(37857, '2025/09', 'test_250x250.webp');
321321
$this->wp->createImage(37857, '2025/09', 'test.webp');
322322

323323
// this will show test_250x250.png but that would also happen on the original img
324324
$input = '<img src="/wp-content/uploads/2025/09/test.png" srcset="/wp-content/uploads/2025/09/test_250x250.png 350w, /wp-content/uploads/2025/09/test.png 2x">';
325-
$expected = '<picture><source srcset="/wp-content/uploads/2025/09/test_250x250.webp 350w, /wp-content/uploads/2025/09/test.png 2x" type="image/webp" /><img src="/wp-content/uploads/2025/09/test.png" srcset="/wp-content/uploads/2025/09/test_250x250.png 350w, /wp-content/uploads/2025/09/test.png 2x"></picture>';
325+
$expected = '<picture><source srcset="/wp-content/uploads/2025/09/test_250x250.webp 350w, /wp-content/uploads/2025/09/test.webp 2x" type="image/webp" /><img src="/wp-content/uploads/2025/09/test.png" srcset="/wp-content/uploads/2025/09/test_250x250.png 350w, /wp-content/uploads/2025/09/test.png 2x"></picture>';
326326
$output = $this->tiny_picture->replace_sources($input);
327327

328328
$this->assertSame($expected, $output);

0 commit comments

Comments
 (0)