Skip to content

Commit

Permalink
Add unit test for a custom image size
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Nov 20, 2024
1 parent bf98e39 commit fefd38b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/test-safe-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public function test_one_pixel_fix() {
'return_in_order' => array(
__DIR__ . '/files/svgCleanOne.svg',
__DIR__ . '/files/svgNoDimensions.svg',
__DIR__ . '/files/svgCleanOne.svg',
),
)
);
Expand Down Expand Up @@ -298,6 +299,19 @@ public function test_one_pixel_fix() {
),
$image_sizes
);

// Test Custom Dimensions
$image_sizes = $this->instance->one_pixel_fix( array(), 1, [ 500, 500 ], false );
if ( ! empty( $image_sizes ) ) {
$image_sizes = array_map( 'intval', $image_sizes );
}
$this->assertSame(
array(
1 => 500,
2 => 500,
),
$image_sizes
);
}

/**
Expand Down

0 comments on commit fefd38b

Please sign in to comment.