Skip to content

Commit e04692d

Browse files
committed
Address remaining PhpStorm static analysis complaints
1 parent e6c54b0 commit e04692d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

plugins/dominant-color-images/tests/test-dominant-color.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function test_tag_add_adjust_to_image_attributes( string $image_path, arr
125125

126126
list( $src, $width, $height ) = wp_get_attachment_image_src( $attachment_id );
127127
// Testing tag_add_adjust() with image being lazy load.
128-
$filtered_image_mock_lazy_load = sprintf( '<img loading="lazy" class="test" src="%s" width="%d" height="%d" />', $src, $width, $height );
128+
$filtered_image_mock_lazy_load = sprintf( '<img loading="lazy" class="test" src="%s" width="%d" height="%d" alt="" />', $src, $width, $height );
129129

130130
$filtered_image_tags_added = dominant_color_img_tag_add_dominant_color( $filtered_image_mock_lazy_load, 'the_content', $attachment_id );
131131

@@ -179,11 +179,11 @@ public function test_dominant_color_img_tag_add_dominant_color_requires_proper_q
179179
public function data_dominant_color_img_tag_add_dominant_color_requires_proper_quotes(): array {
180180
return array(
181181
'double quotes' => array(
182-
'image' => '<img src="%s">',
182+
'image' => '<img src="%s" alt="">',
183183
'expected' => true,
184184
),
185185
'single quotes' => array(
186-
'image' => "<img src='%s'>",
186+
'image' => "<img src='%s' alt=''>",
187187
'expected' => true,
188188
),
189189
);
@@ -222,11 +222,11 @@ public function test_dominant_color_img_tag_add_dominant_color_should_add_domina
222222
public function data_provider_dominant_color_check_inline_style(): array {
223223
return array(
224224
'no existing inline styles' => array(
225-
'filtered_image' => '<img src="%s" width="%d" height="%d" />',
225+
'filtered_image' => '<img src="%s" width="%d" height="%d" alt="" />',
226226
'expected' => 'style="--dominant-color: #fe0000;"',
227227
),
228228
'existing inline styles' => array(
229-
'filtered_image' => '<img style="color: #ffffff;" src="%s" width="%d" height="%d" />',
229+
'filtered_image' => '<img style="color: #ffffff;" src="%s" width="%d" height="%d" alt="" />',
230230
'expected' => 'style="--dominant-color: #fe0000; color: #ffffff;"',
231231
),
232232
);
@@ -298,24 +298,24 @@ public function provider_dominant_color_set_image_editors(): array {
298298
),
299299
'filtered' => array(
300300
'existing' => array(
301-
'WP_Image_Editor_Filered_GD',
302-
'WP_Image_Editor_Filered_Imagick',
301+
'WP_Image_Editor_Filtered_GD',
302+
'WP_Image_Editor_Filtered_Imagick',
303303
),
304304
'expected' => array(
305-
'WP_Image_Editor_Filered_GD',
306-
'WP_Image_Editor_Filered_Imagick',
305+
'WP_Image_Editor_Filtered_GD',
306+
'WP_Image_Editor_Filtered_Imagick',
307307
),
308308
),
309309
'added' => array(
310310
'existing' => array(
311-
'WP_Image_Editor_Filered_GD',
312-
'WP_Image_Editor_Filered_Imagick',
311+
'WP_Image_Editor_Filtered_GD',
312+
'WP_Image_Editor_Filtered_Imagick',
313313
'WP_Image_Editor_GD',
314314
'WP_Image_Editor_Imagick',
315315
),
316316
'expected' => array(
317-
'WP_Image_Editor_Filered_GD',
318-
'WP_Image_Editor_Filered_Imagick',
317+
'WP_Image_Editor_Filtered_GD',
318+
'WP_Image_Editor_Filtered_Imagick',
319319
'Dominant_Color_Image_Editor_GD',
320320
'Dominant_Color_Image_Editor_Imagick',
321321
),

0 commit comments

Comments
 (0)