wp_upload_dir() has a (little-known?) side effect: if you call it, it will attempt to create an uploads directory for the current month. As such, tearDown() and cleanup routines have to be in sync with this behavior when deleting bogus directories used in unit tests.

Examples: if you clean up directories in a test, or a test fails before the directories are cleaned, or a test fails before the `'upload_path'` option is reset, the next call to `wp_upload_dir()` will recreate the directories you just tried to delete.

These changes ensure that `src/foo` and `/tmp/wp-unit-test` directories are deleted immediately after `wp_upload_dir()` is fired in the tests. 
 
Fixes #30513.

Built from https://develop.svn.wordpress.org/trunk@30658


git-svn-id: http://core.svn.wordpress.org/trunk@30648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-11-30 19:06:22 +00:00
parent 15df631e76
commit 3f39605b02

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30657';
$wp_version = '4.1-beta2-30658';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.