WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/12/2014 07:08:15 AM (7 years ago)
Author:
wonderboymusic
Message:

Wouldn't it be incredible if you could run Unit Tests without all of your uploads being indiscriminately blown away and your upload folder permissions being destroyed?

The Future Is Now.

Fixes #28847.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/utils.php

    r28797 r29120  
    314314}
    315315
    316 function _rmdir( $path ) {
    317     if ( in_array(basename( $path ), array( '.', '..' ) ) ) {
    318         return;
    319     } elseif ( is_file( $path ) ) {
    320         unlink( $path );
    321     } elseif ( is_dir( $path ) ) {
    322         foreach ( scandir( $path ) as $file )
    323             _rmdir( $path . '/' . $file );
    324         rmdir( $path );
    325     }
    326 }
    327 
    328316/**
    329317 * Removes the post type and its taxonomy associations.
Note: See TracChangeset for help on using the changeset viewer.