Changeset 9831 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 05/02/2015 08:55:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r9819 r9831 424 424 $wpdb->query( 'COMMIT;' ); 425 425 } 426 427 /** 428 * Clean up created directories/files 429 */ 430 public function rrmdir( $dir ) { 431 // Make sure we are only removing files/dir from uploads 432 if ( 0 !== strpos( $dir, bp_core_avatar_upload_path() ) ) { 433 return; 434 } 435 436 $d = glob( $dir . '/*' ); 437 438 if ( ! empty( $d ) ) { 439 foreach ( $d as $file ) { 440 if ( is_dir( $file ) ) { 441 $this->rrmdir( $file ); 442 } else { 443 @unlink( $file ); 444 } 445 } 446 } 447 448 @rmdir( $dir ); 449 } 426 450 }
Note: See TracChangeset
for help on using the changeset viewer.