Changeset 42343 for trunk/tests/phpunit/tests/upload.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/upload.php
r40523 r42343 22 22 function test_upload_dir_default() { 23 23 // wp_upload_dir() with default parameters 24 $info = wp_upload_dir();25 $subdir = gmstrftime( '/%Y/%m');24 $info = wp_upload_dir(); 25 $subdir = gmstrftime( '/%Y/%m' ); 26 26 27 27 $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] ); … … 34 34 // wp_upload_dir() with a relative upload path that is not 'wp-content/uploads' 35 35 update_option( 'upload_path', 'foo/bar' ); 36 $info = _wp_upload_dir();37 $subdir = gmstrftime( '/%Y/%m');36 $info = _wp_upload_dir(); 37 $subdir = gmstrftime( '/%Y/%m' ); 38 38 39 39 $this->assertEquals( get_option( 'siteurl' ) . '/foo/bar' . $subdir, $info['url'] ); … … 57 57 // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options. 58 58 // It doesn't create the /year/month directories. 59 $info = _wp_upload_dir();60 $subdir = gmstrftime( '/%Y/%m');59 $info = _wp_upload_dir(); 60 $subdir = gmstrftime( '/%Y/%m' ); 61 61 62 62 $this->assertEquals( '/baz' . $subdir, $info['url'] ); … … 83 83 // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options. 84 84 // It doesn't create the /year/month directories. 85 $info = _wp_upload_dir();86 $subdir = gmstrftime( '/%Y/%m');85 $info = _wp_upload_dir(); 86 $subdir = gmstrftime( '/%Y/%m' ); 87 87 88 88 $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] ); … … 94 94 function test_upload_dir_empty() { 95 95 // upload path setting is empty - it should default to 'wp-content/uploads' 96 update_option( 'upload_path', '');96 update_option( 'upload_path', '' ); 97 97 98 98 // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options. 99 99 // It doesn't create the /year/month directories. 100 $info = _wp_upload_dir();101 $subdir = gmstrftime( '/%Y/%m');100 $info = _wp_upload_dir(); 101 $subdir = gmstrftime( '/%Y/%m' ); 102 102 103 103 $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
Note: See TracChangeset
for help on using the changeset viewer.