[wp-trac] [WordPress Trac] #48300: metadata registered using register_meta() do not persist through several tests

WordPress Trac noreply at wordpress.org
Mon Oct 14 21:49:07 UTC 2019


#48300: metadata registered using register_meta() do not persist through several
tests
------------------------------+------------------------------
 Reporter:  leogermani        |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Build/Test Tools  |     Version:  5.1
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  rest-api
------------------------------+------------------------------

Comment (by jnylen0):

 I'll defer to other committers who have been active more recently, but
 yes, I think this is a legitimate bug. Plugins should be able to test
 their post types and meta values without jumping through hoops.

 >A better way to do this might be to save the registered meta keys in
 `setUp` before each test runs, and then restore them in `tearDown`.

 This would fix it. Though now that I think about it, probably need to do
 the same for `setUpBeforeClass` and `tearDownAfterClass` also.

 @peterwilsoncc this resetting of global state happens "piecemeal" and in
 several different places, it's not as clean as what you seem to be
 describing. The specific code that causes this issue with metadata was
 added in [44633].

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


More information about the wp-trac mailing list