Changeset 30404 for trunk/tests/phpunit/tests/multisite/site.php
- Timestamp:
- 11/20/2014 06:52:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/site.php
r30286 r30404 275 275 } 276 276 277 /** 278 * When a site is deleted with wpmu_delete_blog(), only the files associated with 279 * that site should be removed. When wpmu_delete_blog() is run a second time, nothing 280 * should change with upload directories. 281 */ 282 function test_upload_directories_after_multiple_wpmu_delete_blog() { 283 $filename = rand_str().'.jpg'; 284 $contents = rand_str(); 285 286 // Upload a file to the main site on the network. 287 $file1 = wp_upload_bits( $filename, null, $contents ); 288 289 $blog_id = $this->factory->blog->create(); 290 291 switch_to_blog( $blog_id ); 292 $file2 = wp_upload_bits( $filename, null, $contents ); 293 restore_current_blog(); 294 295 wpmu_delete_blog( $blog_id, true ); 296 297 // The file on the main site should still exist. The file on the deleted site should not. 298 $this->assertTrue( file_exists( $file1['file'] ) ); 299 $this->assertFalse( file_exists( $file2['file'] ) ); 300 301 wpmu_delete_blog( $blog_id, true ); 302 303 // The file on the main site should still exist. The file on the deleted site should not. 304 $this->assertTrue( file_exists( $file1['file'] ) ); 305 $this->assertFalse( file_exists( $file2['file'] ) ); 306 } 307 277 308 function test_wpmu_update_blogs_date() { 278 309 global $wpdb;
Note: See TracChangeset
for help on using the changeset viewer.