mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -21,8 +21,8 @@ class Tests_Upload extends WP_UnitTestCase {
|
||||
|
||||
function test_upload_dir_default() {
|
||||
// wp_upload_dir() with default parameters
|
||||
$info = wp_upload_dir();
|
||||
$subdir = gmstrftime('/%Y/%m');
|
||||
$info = wp_upload_dir();
|
||||
$subdir = gmstrftime( '/%Y/%m' );
|
||||
|
||||
$this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
|
||||
$this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
|
||||
@@ -33,8 +33,8 @@ class Tests_Upload extends WP_UnitTestCase {
|
||||
function test_upload_dir_relative() {
|
||||
// wp_upload_dir() with a relative upload path that is not 'wp-content/uploads'
|
||||
update_option( 'upload_path', 'foo/bar' );
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime('/%Y/%m');
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime( '/%Y/%m' );
|
||||
|
||||
$this->assertEquals( get_option( 'siteurl' ) . '/foo/bar' . $subdir, $info['url'] );
|
||||
$this->assertEquals( ABSPATH . 'foo/bar' . $subdir, $info['path'] );
|
||||
@@ -56,8 +56,8 @@ class Tests_Upload extends WP_UnitTestCase {
|
||||
|
||||
// Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
|
||||
// It doesn't create the /year/month directories.
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime('/%Y/%m');
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime( '/%Y/%m' );
|
||||
|
||||
$this->assertEquals( '/baz' . $subdir, $info['url'] );
|
||||
$this->assertEquals( $path . $subdir, $info['path'] );
|
||||
@@ -82,8 +82,8 @@ class Tests_Upload extends WP_UnitTestCase {
|
||||
|
||||
// Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
|
||||
// It doesn't create the /year/month directories.
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime('/%Y/%m');
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime( '/%Y/%m' );
|
||||
|
||||
$this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] );
|
||||
$this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
|
||||
@@ -93,12 +93,12 @@ class Tests_Upload extends WP_UnitTestCase {
|
||||
|
||||
function test_upload_dir_empty() {
|
||||
// upload path setting is empty - it should default to 'wp-content/uploads'
|
||||
update_option('upload_path', '');
|
||||
update_option( 'upload_path', '' );
|
||||
|
||||
// Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
|
||||
// It doesn't create the /year/month directories.
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime('/%Y/%m');
|
||||
$info = _wp_upload_dir();
|
||||
$subdir = gmstrftime( '/%Y/%m' );
|
||||
|
||||
$this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
|
||||
$this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
|
||||
|
||||
Reference in New Issue
Block a user