Skip to content

Commit 114231d

Browse files
committed
Tests: Use the error assertion in image resize tests.
Use `assertWPError()` in image resizing failure tests, preserving the existing error-code assertions. Developed in: #14507 Props shailu25. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64574 602fd350-edb4-49c9-b593-d223f7449a82
1 parent caf396d commit 114231d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tests/phpunit/tests/image/resize.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function test_resize_larger() {
147147
// image_resize() should refuse to make an image larger.
148148
$image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 100, 100 );
149149

150-
$this->assertInstanceOf( 'WP_Error', $image );
150+
$this->assertWPError( $image );
151151
$this->assertSame( 'error_getting_dimensions', $image->get_error_code() );
152152
}
153153

@@ -249,7 +249,7 @@ public function test_resize_thumb_50x150_crop() {
249249
public function test_resize_non_existent_image() {
250250
$image = $this->resize_helper( DIR_TESTDATA . '/images/test-non-existent-image.jpg', 25, 25 );
251251

252-
$this->assertInstanceOf( 'WP_Error', $image );
252+
$this->assertWPError( $image );
253253
$this->assertSame( 'error_loading_image', $image->get_error_code() );
254254
}
255255

0 commit comments

Comments
 (0)