Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 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/user/author.php

    r41173 r42343  
    99class Tests_User_Author_Template extends WP_UnitTestCase {
    1010    protected static $author_id = 0;
    11     protected static $post_id = 0;
     11    protected static $post_id   = 0;
    1212
    1313    private $permalink_structure;
    1414
    1515    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    16         self::$author_id = $factory->user->create( array(
    17             'role' => 'author',
    18             'user_login' => 'test_author',
    19             'description' => 'test_author',
    20         ) );
     16        self::$author_id = $factory->user->create(
     17            array(
     18                'role'        => 'author',
     19                'user_login'  => 'test_author',
     20                'description' => 'test_author',
     21            )
     22        );
    2123
    22         self::$post_id = $factory->post->create( array(
    23             'post_author' => self::$author_id,
    24             'post_status' => 'publish',
    25             'post_content' => rand_str(),
    26             'post_title' => rand_str(),
    27             'post_type' => 'post'
    28         ) );
     24        self::$post_id = $factory->post->create(
     25            array(
     26                'post_author'  => self::$author_id,
     27                'post_status'  => 'publish',
     28                'post_content' => rand_str(),
     29                'post_title'   => rand_str(),
     30                'post_type'    => 'post',
     31            )
     32        );
    2933    }
    3034
     
    4246    function test_get_the_author() {
    4347        $author_name = get_the_author();
    44         $user = new WP_User( self::$author_id );
     48        $user        = new WP_User( self::$author_id );
    4549
    4650        $this->assertEquals( $user->display_name, $author_name );
     
    8993        register_post_type( 'wptests_pt' );
    9094
    91         $cpt_ids = self::factory()->post->create_many( 2, array(
    92             'post_author' => self::$author_id,
    93             'post_type'   => 'wptests_pt',
    94         ) );
     95        $cpt_ids         = self::factory()->post->create_many(
     96            2, array(
     97                'post_author' => self::$author_id,
     98                'post_type'   => 'wptests_pt',
     99            )
     100        );
    95101        $GLOBALS['post'] = $cpt_ids[0];
    96102
     
    104110     */
    105111    public function test_get_the_author_posts_link_no_permalinks() {
    106         $author = self::factory()->user->create_and_get( array(
    107             'display_name'  => 'Foo',
    108             'user_nicename' => 'bar'
    109         ) );
     112        $author = self::factory()->user->create_and_get(
     113            array(
     114                'display_name'  => 'Foo',
     115                'user_nicename' => 'bar',
     116            )
     117        );
    110118
    111119        $GLOBALS['authordata'] = $author->data;
     
    128136        $this->set_permalink_structure( '/%postname%/' );
    129137
    130         $author = self::factory()->user->create_and_get( array(
    131             'display_name'  => 'Foo',
    132             'user_nicename' => 'bar'
    133         ) );
     138        $author = self::factory()->user->create_and_get(
     139            array(
     140                'display_name'  => 'Foo',
     141                'user_nicename' => 'bar',
     142            )
     143        );
    134144
    135145        $GLOBALS['authordata'] = $author;
Note: See TracChangeset for help on using the changeset viewer.