[wp-trac] [WordPress Trac] #60426: Update WP_Test_REST_TestCase::assertErrorResponse() to allow custom failure messages

WordPress Trac noreply at wordpress.org
Fri Apr 26 15:49:35 UTC 2024


#60426: Update WP_Test_REST_TestCase::assertErrorResponse() to allow custom failure
messages
-------------------------------------------------+-------------------------
 Reporter:  antonvlasenko                        |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.6
Component:  Build/Test Tools                     |     Version:
 Severity:  trivial                              |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:  coding-
  tests                                          |  standards
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"58051" 58051]:
 {{{
 #!CommitTicketReference repository="" revision="58051"
 Tests: Add more specific messages for a custom assertion in
 `WP_Test_REST_TestCase`.

 All assertions in PHPUnit have a `$message` parameter. Setting this
 parameter allows to distinguish which assertion is failing when a test
 runs multiple assertions, making debugging of the tests easier.

 Follow-up to [34928], [51478], [58039].

 See #60426.
 }}}

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


More information about the wp-trac mailing list