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/link/wpGetCanonicalURL.php

    r38398 r42343  
    1010
    1111    public static function wpSetUpBeforeClass( $factory ) {
    12         self::$post_id = $factory->post->create( array(
    13             'post_status' => 'publish',
    14         ) );
     12        self::$post_id = $factory->post->create(
     13            array(
     14                'post_status' => 'publish',
     15            )
     16        );
    1517    }
    1618
     
    2628     */
    2729    public function test_post_status() {
    28         $post_id = self::factory()->post->create( array(
    29             'post_status' => 'draft',
    30         ) );
     30        $post_id = self::factory()->post->create(
     31            array(
     32                'post_status' => 'draft',
     33            )
     34        );
    3135
    3236        $this->assertFalse( wp_get_canonical_url( $post_id ) );
     
    4448     */
    4549    public function test_paged_with_plain_permalink_structure() {
    46         $link = add_query_arg( array(
    47             'page' => 2,
    48             'foo'  => 'bar',
    49         ), get_permalink( self::$post_id ) );
     50        $link = add_query_arg(
     51            array(
     52                'page' => 2,
     53                'foo'  => 'bar',
     54            ), get_permalink( self::$post_id )
     55        );
    5056
    5157        $this->go_to( $link );
    5258
    53         $expected = add_query_arg( array(
    54             'page' => 2,
    55         ), get_permalink( self::$post_id ) );
     59        $expected = add_query_arg(
     60            array(
     61                'page' => 2,
     62            ), get_permalink( self::$post_id )
     63        );
    5664
    5765        $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
     
    6573        $page = 2;
    6674
    67         $link = add_query_arg( array(
    68             'page' => $page,
    69             'foo'  => 'bar',
    70         ), get_permalink( self::$post_id ) );
     75        $link = add_query_arg(
     76            array(
     77                'page' => $page,
     78                'foo'  => 'bar',
     79            ), get_permalink( self::$post_id )
     80        );
    7181
    7282        $this->go_to( $link );
     
    8393        $cpage = 2;
    8494
    85         $link = add_query_arg( array(
    86             'cpage' => $cpage,
    87             'foo'   => 'bar',
    88         ), get_permalink( self::$post_id ) );
     95        $link = add_query_arg(
     96            array(
     97                'cpage' => $cpage,
     98                'foo'   => 'bar',
     99            ), get_permalink( self::$post_id )
     100        );
    89101
    90102        $this->go_to( $link );
    91103
    92         $expected = add_query_arg( array(
    93             'cpage' => $cpage,
    94         ), get_permalink( self::$post_id ) . '#comments' );
     104        $expected = add_query_arg(
     105            array(
     106                'cpage' => $cpage,
     107            ), get_permalink( self::$post_id ) . '#comments'
     108        );
    95109
    96         $this->assertEquals( $expected , wp_get_canonical_url( self::$post_id ) );
     110        $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
    97111    }
    98112
     
    106120        $cpage = 2;
    107121
    108         $link = add_query_arg( array(
    109             'cpage' => $cpage,
    110             'foo'   => 'bar',
    111         ), get_permalink( self::$post_id ) );
     122        $link = add_query_arg(
     123            array(
     124                'cpage' => $cpage,
     125                'foo'   => 'bar',
     126            ), get_permalink( self::$post_id )
     127        );
    112128
    113129        $this->go_to( $link );
     
    115131        $expected = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' ) . '#comments';
    116132
    117         $this->assertEquals( $expected , wp_get_canonical_url( self::$post_id ) );
     133        $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
    118134    }
    119135
Note: See TracChangeset for help on using the changeset viewer.