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/wpDeleteUser.php

    r40564 r42343  
    1616
    1717        $user_id = self::factory()->user->create( array( 'role' => 'subscriber' ) );
    18         $blogs = get_blogs_of_user( $user_id );
     18        $blogs   = get_blogs_of_user( $user_id );
    1919        $this->assertEquals( array( 1 ), array_keys( $blogs ) );
    2020
     
    5656    function test_delete_user() {
    5757        $user_id = self::factory()->user->create( array( 'role' => 'author' ) );
    58         $user = new WP_User( $user_id );
     58        $user    = new WP_User( $user_id );
    5959
    6060        $post = array(
    61             'post_author' => $user_id,
    62             'post_status' => 'publish',
     61            'post_author'  => $user_id,
     62            'post_status'  => 'publish',
    6363            'post_content' => 'Post content',
    64             'post_title' => 'Post Title',
    65             'post_type' => 'post',
     64            'post_title'   => 'Post Title',
     65            'post_type'    => 'post',
    6666        );
    6767
    6868        // insert a post and make sure the ID is ok
    69         $post_id = wp_insert_post($post);
    70         $this->assertTrue(is_numeric($post_id));
    71         $this->assertTrue($post_id > 0);
     69        $post_id = wp_insert_post( $post );
     70        $this->assertTrue( is_numeric( $post_id ) );
     71        $this->assertTrue( $post_id > 0 );
    7272
    7373        $post = get_post( $post_id );
     
    7575
    7676        $post = array(
    77             'post_author' => $user_id,
    78             'post_status' => 'publish',
     77            'post_author'  => $user_id,
     78            'post_status'  => 'publish',
    7979            'post_content' => 'Post content',
    80             'post_title' => 'Post Title',
    81             'post_type' => 'nav_menu_item',
     80            'post_title'   => 'Post Title',
     81            'post_type'    => 'nav_menu_item',
    8282        );
    8383
    8484        // insert a post and make sure the ID is ok
    85         $nav_id = wp_insert_post($post);
    86         $this->assertTrue(is_numeric($nav_id));
    87         $this->assertTrue($nav_id > 0);
     85        $nav_id = wp_insert_post( $post );
     86        $this->assertTrue( is_numeric( $nav_id ) );
     87        $this->assertTrue( $nav_id > 0 );
    8888
    8989        $post = get_post( $nav_id );
     
    9292        wp_delete_user( $user_id );
    9393        $user = new WP_User( $user_id );
    94         if ( is_multisite() )
     94        if ( is_multisite() ) {
    9595            $this->assertTrue( $user->exists() );
    96         else
     96        } else {
    9797            $this->assertFalse( $user->exists() );
     98        }
    9899
    99100        $this->assertNotNull( get_post( $post_id ) );
     
    112113     */
    113114    function test_wp_delete_user_reassignment_clears_post_caches() {
    114         $user_id   = self::factory()->user->create();
    115         $reassign  = self::factory()->user->create();
    116         $post_id   = self::factory()->post->create( array( 'post_author' => $user_id ) );
     115        $user_id  = self::factory()->user->create();
     116        $reassign = self::factory()->user->create();
     117        $post_id  = self::factory()->post->create( array( 'post_author' => $user_id ) );
    117118
    118119        get_post( $post_id ); // Ensure this post is in the cache.
Note: See TracChangeset for help on using the changeset viewer.