Skip to content

Commit e764b51

Browse files
Apply suggestions from code review
1 parent ab81e22 commit e764b51

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

plugins/auto-sizes/tests/test-auto-sizes.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,10 @@ public function test_auto_sizes_update_content_img_tag( string $input, string $e
294294
*/
295295
public function test_auto_sizes_attribute_includes_valid_auto(): void {
296296
// Test when 'auto' is the first item in the list.
297-
$sizes_attr = 'auto, 100vw';
298-
$this->assertTrue( auto_sizes_attribute_includes_valid_auto( $sizes_attr ) );
297+
$this->assertTrue( auto_sizes_attribute_includes_valid_auto( 'auto, 100vw' ) );
299298

300299
// Test when 'auto' is not the first item in the list.
301-
$sizes_attr = '100vw, auto';
302-
$this->assertFalse( auto_sizes_attribute_includes_valid_auto( $sizes_attr ) );
300+
$this->assertFalse( auto_sizes_attribute_includes_valid_auto( '100vw, auto' ) );
303301
}
304302

305303
/**
@@ -366,11 +364,11 @@ public function test_auto_sizes_update_image_attributes( array $attr, array $exp
366364
*/
367365
public function test_auto_sizes_update_content_img_tag_non_string_input(): void {
368366
/*
369-
These tests are separate from the data provider approach because the function
370-
auto_sizes_update_content_img_tag() expects a string as an argument. Passing a non-string
371-
value would cause a TypeError. These tests ensure that the function behaves as expected
372-
when it receives non-string inputs.
373-
*/
367+
* These tests are separate from the data provider approach because the function
368+
* auto_sizes_update_content_img_tag() expects a string as an argument. Passing a non-string
369+
* value would cause a TypeError. These tests ensure that the function behaves as expected
370+
* when it receives non-string inputs.
371+
*/
374372
$this->assertSame( '', auto_sizes_update_content_img_tag( array() ) );
375373
}
376374

@@ -379,12 +377,12 @@ public function test_auto_sizes_update_content_img_tag_non_string_input(): void
379377
*/
380378
public function test_auto_sizes_update_image_attributes_with_null_input(): void {
381379
/*
382-
This test is separate because the main test method uses a data provider
383-
that expects the $attr parameter to be an array. Passing null directly
384-
would cause a TypeError due to the type hint. By testing null separately,
385-
we ensure that the function can handle null inputs gracefully without
386-
modifying the type hint in the main test method.
387-
*/
380+
* This test is separate because the main test method uses a data provider
381+
* that expects the $attr parameter to be an array. Passing null directly
382+
* would cause a TypeError due to the type hint. By testing null separately,
383+
* we ensure that the function can handle null inputs gracefully without
384+
* modifying the type hint in the main test method.
385+
*/
388386
$this->assertSame( array(), auto_sizes_update_image_attributes( null ) );
389387
}
390388
}

0 commit comments

Comments
 (0)