- Timestamp:
- 08/09/2021 07:08:09 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php
r51568 r51587 36 36 37 37 $site = get_current_site(); 38 $date = date_format( date_create( 'now' ), 'Y/m' ); 38 39 39 40 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 40 41 $blog_id2 = self::factory()->blog->create( array( 'user_id' => $user_id ) ); 41 42 $info = wp_upload_dir(); 42 $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );43 $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );44 $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );43 $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . $date, $info['url'] ); 44 $this->assertSame( ABSPATH . 'wp-content/uploads/' . $date, $info['path'] ); 45 $this->assertSame( '/' . $date, $info['subdir'] ); 45 46 $this->assertFalse( $info['error'] ); 46 47 … … 48 49 $info2 = wp_upload_dir(); 49 50 $this->assertNotEquals( $info, $info2 ); 50 $this->assertSame( get_option( 'siteurl' ) . '/wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['url'] );51 $this->assertSame( ABSPATH . 'wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['path'] );52 $this->assertSame( gmstrftime( '/%Y/%m' ), $info2['subdir'] );51 $this->assertSame( get_option( 'siteurl' ) . '/wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . $date, $info2['url'] ); 52 $this->assertSame( ABSPATH . 'wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . $date, $info2['path'] ); 53 $this->assertSame( '/' . $date, $info2['subdir'] ); 53 54 $this->assertFalse( $info2['error'] ); 54 55 restore_current_blog();
Note: See TracChangeset
for help on using the changeset viewer.