- Timestamp:
- 11/20/2014 06:52:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php
r30286 r30404 56 56 restore_current_blog(); 57 57 } 58 59 /** 60 * When a site is deleted with wpmu_delete_blog(), only the files associated with 61 * that site should be removed. When wpmu_delete_blog() is run a second time, nothing 62 * should change with upload directories. 63 */ 64 function test_upload_directories_after_multiple_wpmu_delete_blog_with_ms_files() { 65 $filename = rand_str().'.jpg'; 66 $contents = rand_str(); 67 68 // Upload a file to the main site on the network. 69 $file1 = wp_upload_bits( $filename, null, $contents ); 70 71 $blog_id = $this->factory->blog->create(); 72 73 switch_to_blog( $blog_id ); 74 $file2 = wp_upload_bits( $filename, null, $contents ); 75 restore_current_blog(); 76 77 wpmu_delete_blog( $blog_id, true ); 78 79 // The file on the main site should still exist. The file on the deleted site should not. 80 $this->assertTrue( file_exists( $file1['file'] ) ); 81 $this->assertFalse( file_exists( $file2['file'] ) ); 82 83 wpmu_delete_blog( $blog_id, true ); 84 85 // The file on the main site should still exist. The file on the deleted site should not. 86 $this->assertTrue( file_exists( $file1['file'] ) ); 87 $this->assertFalse( file_exists( $file2['file'] ) ); 88 } 58 89 } 59 90
Note: See TracChangeset
for help on using the changeset viewer.