Changeset 677 in tests
- Timestamp:
- 04/12/2012 05:02:12 PM (12 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_includes_post.php
r675 r677 449 449 update_option('thumbnail_size_w', 150); 450 450 update_option('thumbnail_size_h', 150); 451 452 $this->_destroy_uploads(); 451 453 } 452 454 -
wp-testlib/base.php
r675 r677 409 409 } 410 410 411 function _destroy_uploads() { 412 $uploads = wp_upload_dir(); 413 foreach ( scandir( $uploads['basedir'] ) as $file ) 414 _rmdir( $uploads['basedir'] . '/' . $file ); 415 } 416 411 417 /** 412 418 * Checks if track ticket #$ticket_id is resolved … … 647 653 wp_ob_end_flush_all(); 648 654 parent::tearDown(); 649 // delete any users that were created during tests655 // delete any users and uploads that were created during tests 650 656 $this->_destroy_users(); 657 $this->_destroy_uploads(); 651 658 652 659 remove_filter( 'pre_option_enable_xmlrpc', '__return_true' ); -
wp-testlib/utils.php
r561 r677 335 335 } 336 336 337 function _rmdir( $path ) { 338 if ( in_array(basename( $path ), array( '.', '..' ) ) ) { 339 return; 340 } elseif ( is_file( $path ) ) { 341 unlink( $path ); 342 } elseif ( is_dir( $path ) ) { 343 foreach ( scandir( $path ) as $file ) 344 _rmdir( $path . '/' . $file ); 345 rmdir( $path ); 346 } 347 } 348 337 349 ?>
Note: See TracChangeset
for help on using the changeset viewer.