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/post/getPageUri.php

    r38145 r42343  
    1010     */
    1111    function test_get_page_uri_with_stdclass_post_object() {
    12         $post_id    = self::factory()->post->create( array( 'post_name' => 'get-page-uri-post-name' ) );
     12        $post_id = self::factory()->post->create( array( 'post_name' => 'get-page-uri-post-name' ) );
    1313
    1414        // Mimick an old stdClass post object, missing the ancestors field.
     
    3434    function test_get_post_uri_check_orphan() {
    3535        $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) );
    36         $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) );
     36        $child_id  = self::factory()->post->create(
     37            array(
     38                'post_name'   => 'child',
     39                'post_parent' => $parent_id,
     40            )
     41        );
    3742
    3843        // check the parent for good measure
     
    5257    function test_get_page_uri_with_a_draft_parent_with_empty_slug() {
    5358        $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) );
    54         $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) );
     59        $child_id  = self::factory()->post->create(
     60            array(
     61                'post_name'   => 'child',
     62                'post_parent' => $parent_id,
     63            )
     64        );
    5565
    56         wp_update_post( array( 'ID' => $parent_id, 'post_name' => '', 'post_status' => 'draft' ) );
     66        wp_update_post(
     67            array(
     68                'ID'          => $parent_id,
     69                'post_name'   => '',
     70                'post_status' => 'draft',
     71            )
     72        );
    5773
    5874        $this->assertEquals( 'child', get_page_uri( $child_id ) );
     
    6379     */
    6480    function test_get_page_uri_without_argument() {
    65         $post_id = self::factory()->post->create(array(
    66             'post_title' => 'Blood Orange announces summer tour dates',
    67             'post_name' => 'blood-orange-announces-summer-tour-dates',
    68         ));
    69         $post = get_post( $post_id );
     81        $post_id = self::factory()->post->create(
     82            array(
     83                'post_title' => 'Blood Orange announces summer tour dates',
     84                'post_name'  => 'blood-orange-announces-summer-tour-dates',
     85            )
     86        );
     87        $post    = get_post( $post_id );
    7088        $this->go_to( get_permalink( $post_id ) );
    7189        $this->assertEquals( 'blood-orange-announces-summer-tour-dates', get_page_uri() );
Note: See TracChangeset for help on using the changeset viewer.