@@ -23,6 +23,8 @@ public function wp_image_editors() {
2323 public function test_resize_jpg () {
2424 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/test-image.jpg ' , 25 , 25 );
2525
26+ $ this ->assertNotWPError ( $ image );
27+
2628 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
2729
2830 unlink ( $ image );
@@ -78,6 +80,8 @@ public function test_resize_webp() {
7880
7981 $ image = $ this ->resize_helper ( $ file , 25 , 25 );
8082
83+ $ this ->assertNotWPError ( $ image );
84+
8185 list ( $ w , $ h , $ type ) = wp_getimagesize ( $ image );
8286
8387 unlink ( $ image );
@@ -99,6 +103,8 @@ public function test_resize_larger() {
99103 public function test_resize_thumb_128x96 () {
100104 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG ' , 128 , 96 );
101105
106+ $ this ->assertNotWPError ( $ image );
107+
102108 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
103109
104110 unlink ( $ image );
@@ -112,6 +118,8 @@ public function test_resize_thumb_128x96() {
112118 public function test_resize_thumb_128x0 () {
113119 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG ' , 128 , 0 );
114120
121+ $ this ->assertNotWPError ( $ image );
122+
115123 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
116124
117125 unlink ( $ image );
@@ -125,6 +133,8 @@ public function test_resize_thumb_128x0() {
125133 public function test_resize_thumb_0x96 () {
126134 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG ' , 0 , 96 );
127135
136+ $ this ->assertNotWPError ( $ image );
137+
128138 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
129139
130140 unlink ( $ image );
@@ -138,6 +148,8 @@ public function test_resize_thumb_0x96() {
138148 public function test_resize_thumb_150x150_crop () {
139149 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG ' , 150 , 150 , true );
140150
151+ $ this ->assertNotWPError ( $ image );
152+
141153 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
142154
143155 unlink ( $ image );
@@ -164,6 +176,8 @@ public function test_resize_thumb_150x100_crop() {
164176 public function test_resize_thumb_50x150_crop () {
165177 $ image = $ this ->resize_helper ( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG ' , 50 , 150 , true );
166178
179+ $ this ->assertNotWPError ( $ image );
180+
167181 list ( $ w , $ h , $ type ) = getimagesize ( $ image );
168182
169183 unlink ( $ image );
@@ -188,6 +202,8 @@ public function test_resize_non_existent_image() {
188202
189203 /**
190204 * Function to help out the tests
205+ *
206+ * @return string|WP_Error The path to the resized image file or a WP_Error on failure.
191207 */
192208 protected function resize_helper ( $ file , $ width , $ height , $ crop = false ) {
193209 $ editor = wp_get_image_editor ( $ file );
0 commit comments