[wp-trac] [WordPress Trac] #55654: Tests: Reduce usage of assertEquals for 6.1

WordPress Trac noreply at wordpress.org
Fri Oct 7 01:21:10 UTC 2022


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

Comment (by SergeyBiryukov):

 Thanks for the commit! [54402] looks great to me.

 Replying to [comment:8 desrosj]:
 > Some of these just require a deeper look to confirm the intended type is
 being checked for.

 Right, that is the reason I was careful with this in earlier iterations.
 As noted in comment:19:ticket:38266:
 * In some cases, the tests should be adjusted to use the correct data
 type.
 * In other cases, this points to minor bugs in core, e.g. using `ceil()`
 for values that are documented as integers, but without explicitly casting
 to `int`, results in them being of type `float` instead. This affects some
 properties like `max_num_pages`, `max_pages`, `total_pages` in various
 classes, or functions like `get_comment_pages_count()`,
 `wp_embed_defaults()`, `get_oembed_response_data()`.

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


More information about the wp-trac mailing list