Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/upload.php

    r40523 r42343  
    2222    function test_upload_dir_default() {
    2323        // 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' );
    2626
    2727        $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
     
    3434        // wp_upload_dir() with a relative upload path that is not 'wp-content/uploads'
    3535        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' );
    3838
    3939        $this->assertEquals( get_option( 'siteurl' ) . '/foo/bar' . $subdir, $info['url'] );
     
    5757        // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
    5858        // 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' );
    6161
    6262        $this->assertEquals( '/baz' . $subdir, $info['url'] );
     
    8383        // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
    8484        // 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' );
    8787
    8888        $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] );
     
    9494    function test_upload_dir_empty() {
    9595        // upload path setting is empty - it should default to 'wp-content/uploads'
    96         update_option('upload_path', '');
     96        update_option( 'upload_path', '' );
    9797
    9898        // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
    9999        // 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' );
    102102
    103103        $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
Note: See TracChangeset for help on using the changeset viewer.