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/general/template.php

    r40817 r42343  
    7171
    7272    /**
    73      * @group site_icon
     73     * @group site_icon
    7474     * @group multisite
    7575     * @group ms-required
     
    232232        $contents = file_get_contents( $filename );
    233233
    234         $upload = wp_upload_bits( basename( $filename ), null, $contents );
     234        $upload              = wp_upload_bits( basename( $filename ), null, $contents );
    235235        $this->site_icon_url = $upload['url'];
    236 
    237236
    238237        // Save the data
     
    324323        restore_current_blog();
    325324
    326         $expected_custom_logo =  '<a href="' . $home_url . '" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>';
     325        $expected_custom_logo = '<a href="' . $home_url . '" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>';
    327326        $this->assertEquals( $expected_custom_logo, get_custom_logo( $blog_id ) );
    328327    }
     
    367366        update_post_meta( $this->custom_logo_id, '_wp_attachment_image_alt', $image_alt );
    368367
    369         $image = wp_get_attachment_image( $this->custom_logo_id, 'full', false, array(
    370             'class'    => 'custom-logo',
    371             'itemprop' => 'logo',
    372         ) );
     368        $image = wp_get_attachment_image(
     369            $this->custom_logo_id, 'full', false, array(
     370                'class'    => 'custom-logo',
     371                'itemprop' => 'logo',
     372            )
     373        );
    373374
    374375        $this->expectOutputString( '<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>' );
     
    423424    function test_get_the_modified_time_default() {
    424425        $details = array(
    425                 'post_date' => '2016-01-21 15:34:36',
    426                 'post_date_gmt' => '2016-01-21 15:34:36',
     426            'post_date'    => '2016-01-21 15:34:36',
     427            'post_date_gmt' => '2016-01-21 15:34:36',
    427428        );
    428429        $post_id = $this->factory->post->create( $details );
    429         $post = get_post( $post_id );
     430        $post    = get_post( $post_id );
    430431
    431432        $GLOBALS['post'] = $post;
    432433
    433434        $expected = '1453390476';
    434         $d = 'G';
    435         $actual = get_the_modified_time( $d );
     435        $d        = 'G';
     436        $actual   = get_the_modified_time( $d );
    436437        $this->assertEquals( $expected, $actual );
    437438    }
     
    474475     */
    475476    function test_get_the_modified_date_with_post_id() {
    476         $details = array(
    477                 'post_date' => '2016-01-21 15:34:36',
    478                 'post_date_gmt' => '2016-01-21 15:34:36',
    479         );
    480         $post_id = $this->factory->post->create( $details );
    481         $d = 'Y-m-d';
     477        $details  = array(
     478            'post_date'    => '2016-01-21 15:34:36',
     479            'post_date_gmt' => '2016-01-21 15:34:36',
     480        );
     481        $post_id  = $this->factory->post->create( $details );
     482        $d        = 'Y-m-d';
    482483        $expected = '2016-01-21';
    483         $actual = get_the_modified_date( $d, $post_id );
     484        $actual   = get_the_modified_date( $d, $post_id );
    484485        $this->assertEquals( $expected, $actual );
    485486    }
     
    494495    function test_get_the_modified_date_default() {
    495496        $details = array(
    496                 'post_date' => '2016-01-21 15:34:36',
    497                 'post_date_gmt' => '2016-01-21 15:34:36',
     497            'post_date'    => '2016-01-21 15:34:36',
     498            'post_date_gmt' => '2016-01-21 15:34:36',
    498499        );
    499500        $post_id = $this->factory->post->create( $details );
    500         $post = get_post( $post_id );
     501        $post    = get_post( $post_id );
    501502
    502503        $GLOBALS['post'] = $post;
    503504
    504505        $expected = '2016-01-21';
    505         $d = 'Y-m-d';
    506         $actual = get_the_modified_date( $d );
     506        $d        = 'Y-m-d';
     507        $actual   = get_the_modified_date( $d );
    507508        $this->assertEquals( $expected, $actual );
    508509    }
     
    545546     */
    546547    function test_get_the_modified_time_with_post_id() {
    547         $details = array(
    548                 'post_date' => '2016-01-21 15:34:36',
    549                 'post_date_gmt' => '2016-01-21 15:34:36',
    550         );
    551         $post_id = $this->factory->post->create( $details );
    552         $d = 'G';
     548        $details  = array(
     549            'post_date'    => '2016-01-21 15:34:36',
     550            'post_date_gmt' => '2016-01-21 15:34:36',
     551        );
     552        $post_id  = $this->factory->post->create( $details );
     553        $d        = 'G';
    553554        $expected = '1453390476';
    554         $actual = get_the_modified_time( $d, $post_id );
     555        $actual   = get_the_modified_time( $d, $post_id );
    555556        $this->assertEquals( $expected, $actual );
    556557    }
Note: See TracChangeset for help on using the changeset viewer.