[wp-trac] [WordPress Trac] #27410: Clear object cache between tests

WordPress Trac noreply at wordpress.org
Fri Mar 14 05:03:46 UTC 2014


#27410: Clear object cache between tests
------------------------------+-----------------------------
 Reporter:  rmccue            |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 Working on some testing stuff at the moment, and it turns out that without
 clearing the user cache between tests, using
 `$this->factory->user->create` in `setUp` won't work.

 Steps to reproduce:
 1. Create test case class
 2. Add `$this->factory->user->create()` to `setUp`
 3. Add more than one test method

 The current workaround is to call `clean_user_cache( $this->test_user );`
 in `tearDown`, but it seems that clearing the whole of the object cache
 should be handled in `tearDown` automatically?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27410>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list