[wp-trac] [WordPress Trac] #56800: Tests: Reduce usage of assertEquals for 6.2

WordPress Trac noreply at wordpress.org
Mon Mar 6 16:27:38 UTC 2023


#56800: Tests: Reduce usage of assertEquals for 6.2
---------------------------------------------+-----------------------------
 Reporter:  desrosj                          |       Owner:  hellofromTonya
     Type:  defect (bug)                     |      Status:  reviewing
 Priority:  normal                           |   Milestone:  6.2
Component:  Build/Test Tools                 |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-----------------------------

Comment (by hellofromTonya):

 In [changeset:"55467" 55467]:
 {{{
 #!CommitTicketReference repository="" revision="55467"
 Tests: Improve
 Tests_Media::test_wp_generate_attachment_metadata_doesnt_generate_sizes_for_150_square_image().

 Changes:

 * from `assertEquals()` to `assertSame()`. Why? To ensure both the return
 value and data type match the expected results.

 * the expected height and width from `string` to `integer` data types. Why
 integer? `getimagesize()` (within `wp_getimagesize()`) will return an
 integer for both height and weight.

 * adds the ticket annotation.

 * adds assertion failure messages. Why? To denote which assertion failed,
 which aids in debugging efforts.

 Follow-up to [55278].

 Props costdev, peterwilsoncc, mukesh27, ankitmaru, hellofromTonya.
 See #56800, #57370.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56800#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list