Skip to content

Commit eaa6dfa

Browse files
Use associative array in data provider
1 parent 3ef8910 commit eaa6dfa

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -307,39 +307,43 @@ public function test_auto_sizes_attribute_includes_valid_auto(): void {
307307
*/
308308
public function data_provider_for_auto_sizes_update_image_attributes(): array {
309309
return array(
310-
array(
311-
array(
310+
'does_not_modify_eager_image' => array(
311+
'attr' => array(
312312
'loading' => 'eager',
313313
'sizes' => '100vw',
314314
),
315-
array(
315+
'expected' => array(
316316
'loading' => 'eager',
317317
'sizes' => '100vw',
318318
),
319319
),
320320

321-
// Test when the image is not responsive.
322-
array( array( 'loading' => 'lazy' ), array( 'loading' => 'lazy' ) ),
321+
'does_not_modify_non_responsive_image' => array(
322+
'attr' => array(
323+
'loading' => 'lazy',
324+
),
325+
'expected' => array(
326+
'loading' => 'lazy',
327+
),
328+
),
323329

324-
// Test when 'auto' already exists in the sizes attribute.
325-
array(
326-
array(
330+
'does_not_duplicate_auto_in_sizes' => array(
331+
'attr' => array(
327332
'loading' => 'lazy',
328333
'sizes' => 'auto, 100vw',
329334
),
330-
array(
335+
'expected' => array(
331336
'loading' => 'lazy',
332337
'sizes' => 'auto, 100vw',
333338
),
334339
),
335340

336-
// Test when 'auto' needs to be added to the sizes attribute.
337-
array(
338-
array(
341+
'adds_auto_to_sizes_when_needed' => array(
342+
'attr' => array(
339343
'loading' => 'lazy',
340344
'sizes' => '100vw',
341345
),
342-
array(
346+
'expected' => array(
343347
'loading' => 'lazy',
344348
'sizes' => 'auto, 100vw',
345349
),

0 commit comments

Comments
 (0)