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/xmlrpc/wp/getPost.php

    r40417 r42343  
    1313        parent::setUp();
    1414
    15         $this->post_date_ts = strtotime( '+1 day' );
    16         $this->post_data = array(
    17             'post_title' => rand_str(),
     15        $this->post_date_ts            = strtotime( '+1 day' );
     16        $this->post_data               = array(
     17            'post_title'   => rand_str(),
    1818            'post_content' => rand_str( 2000 ),
    1919            'post_excerpt' => rand_str( 100 ),
    20             'post_author' => $this->make_user_by_role( 'author' ),
    21             'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
     20            'post_author'  => $this->make_user_by_role( 'author' ),
     21            'post_date'    => strftime( '%Y-%m-%d %H:%M:%S', $this->post_date_ts ),
    2222        );
    23         $this->post_id = wp_insert_post( $this->post_data );
    24         $this->post_custom_field = array( 'key' => 'test_custom_field', 'value' => 12345678);
     23        $this->post_id                 = wp_insert_post( $this->post_data );
     24        $this->post_custom_field       = array(
     25            'key'   => 'test_custom_field',
     26            'value' => 12345678,
     27        );
    2528        $this->post_custom_field['id'] = add_post_meta( $this->post_id, $this->post_custom_field['key'], $this->post_custom_field['value'] );
    2629    }
     
    110113        $this->assertEquals( $this->post_date_ts, $result['post_modified']->getTimestamp() );
    111114
    112         $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
     115        $post_date_gmt     = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
    113116        $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
    114117
     
    124127
    125128        $parent_page_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
    126         $child_page_id = self::factory()->post->create( array(
    127             'post_type' => 'page',
    128             'post_parent' => $parent_page_id,
    129             'menu_order' => 2
    130         ) );
     129        $child_page_id  = self::factory()->post->create(
     130            array(
     131                'post_type'   => 'page',
     132                'post_parent' => $parent_page_id,
     133                'menu_order'  => 2,
     134            )
     135        );
    131136
    132137        $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) );
Note: See TracChangeset for help on using the changeset viewer.