[wp-trac] [WordPress Trac] #54662: The `test_get_terms_post_args_paging()` test performs no assertions

WordPress Trac noreply at wordpress.org
Fri Aug 19 16:16:35 UTC 2022


#54662: The `test_get_terms_post_args_paging()` test performs no assertions
-------------------------------+---------------------
 Reporter:  johnbillion        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  6.1
Component:  REST API           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:3 costdev]:
 > I believe to make
 `WP_Test_REST_Tags_Controller::test_get_terms_post_args_paging()` perform
 assertions:
 >
 > 1. The only ''necessary'' fix is:
 >
 > {{{#!php
 > // Line 57
 >
 > // Change
 > $tag_ids[] = $factory->tag->create(
 >
 > // To
 > self::$tag_ids[] = $factory->tag->create(
 > }}}
 >
 > 2. Additionally, using `$this->assertNotEmpty( $tags )` before each
 `foreach` loop would stabilise the tests by ensuring they fail if the
 response returns empty.

 Good catch! This needed to be fixed either way and should now be resolved
 in [53909].

 Keeping the ticket open for now for any additional improvements.

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


More information about the wp-trac mailing list