From 2477e3f479e561902500fe2b5aa600dc7635aba6 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 6 Nov 2024 15:11:58 +0530 Subject: [PATCH] Remove false negative checks --- plugins/webp-uploads/tests/test-image-edit.php | 1 - plugins/webp-uploads/tests/test-load.php | 5 ----- 2 files changed, 6 deletions(-) diff --git a/plugins/webp-uploads/tests/test-image-edit.php b/plugins/webp-uploads/tests/test-image-edit.php index fa4ec310c1..7bfb0b9606 100644 --- a/plugins/webp-uploads/tests/test-image-edit.php +++ b/plugins/webp-uploads/tests/test-image-edit.php @@ -77,7 +77,6 @@ public function test_it_should_restore_the_sources_array_from_the_backup_when_an wp_restore_image( $attachment_id ); - $this->assertImageNotHasSource( $attachment_id, 'image/jpeg' ); $this->assertImageHasSource( $attachment_id, 'image/webp' ); $metadata = wp_get_attachment_metadata( $attachment_id ); diff --git a/plugins/webp-uploads/tests/test-load.php b/plugins/webp-uploads/tests/test-load.php index f70fd19e9f..050b9d8bde 100644 --- a/plugins/webp-uploads/tests/test-load.php +++ b/plugins/webp-uploads/tests/test-load.php @@ -55,7 +55,6 @@ public function test_it_should_not_create_the_original_mime_type_for_jpeg_images // There should be an image_type source, but no JPEG source for the full image. $this->assertImageHasSource( $attachment_id, $mime_type ); - $this->assertImageNotHasSource( $attachment_id, 'image/jpeg' ); $metadata = wp_get_attachment_metadata( $attachment_id ); @@ -263,8 +262,6 @@ public function test_it_should_create_a_webp_version_with_all_the_required_prope $file = get_attached_file( $attachment_id, true ); $dirname = pathinfo( $file, PATHINFO_DIRNAME ); - $this->assertImageNotHasSource( $attachment_id, 'image/jpeg' ); - $this->assertImageHasSource( $attachment_id, 'image/webp' ); $this->assertFileExists( path_join( $dirname, $metadata['sources']['image/webp']['file'] ) ); $this->assertSame( $metadata['sources']['image/webp']['filesize'], wp_filesize( path_join( $dirname, $metadata['sources']['image/webp']['file'] ) ) ); @@ -285,7 +282,6 @@ public function test_it_should_create_the_full_size_images_when_no_size_is_avail $metadata = wp_get_attachment_metadata( $attachment_id ); $this->assertEmpty( $metadata['sizes'] ); - $this->assertImageNotHasSource( $attachment_id, 'image/jpeg' ); $this->assertImageHasSource( $attachment_id, 'image/webp' ); } @@ -706,7 +702,6 @@ static function ( $editors ) { $this->assertArrayHasKey( 'sources', $metadata ); $this->assertIsArray( $metadata['sources'] ); - $this->assertImageNotHasSource( $attachment_id, 'image/jpeg' ); $this->assertImageHasSource( $attachment_id, 'image/' . $image_type ); $this->assertImageNotHasSizeSource( $attachment_id, 'thumbnail', 'image/jpeg' );