[wp-trac] [WordPress Trac] #38264: Tests: Uploads aren't deleted after running individual tests

WordPress Trac noreply at wordpress.org
Sat Oct 8 23:46:03 UTC 2016


#38264: Tests: Uploads aren't deleted after running individual tests
------------------------------+---------------------------------------
 Reporter:  johnbillion       |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch needs-testing
  Focuses:                    |
------------------------------+---------------------------------------
 Steps to reproduce:

 1. Run `phpunit` and verify the tests pass.
 2. Run `phpunit --filter
 test_wp_get_attachment_image_should_use_wp_get_attachment_metadata` and
 verify the tests pass.
 3. Run `phpunit --filter
 test_wp_get_attachment_image_should_use_wp_get_attachment_metadata` a
 second time and observe that the tests fail.

 View the contents of your site's `uploads` directory and you'll observe
 that the `2016/10/test-image-large.png` file and its resized versions
 haven't been deleted, and get created anew each time the test runs.

 The same thing happens when running any test on its own that adds an
 attachment. The reason the
 `test_wp_get_attachment_image_should_use_wp_get_attachment_metadata` test
 fails the second time is because of its overly strict assumption about the
 contents of the `<img>` tag. This failure caused me to notice the fact
 that the upload file wasn't being deleted.

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


More information about the wp-trac mailing list