Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 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/category/getCategoryParents.php

    r39549 r42343  
    1212
    1313                $this->c1 = self::factory()->category->create_and_get();
    14                 $this->c2 = self::factory()->category->create_and_get( array(
    15                         'parent' => $this->c1->term_id,
    16                 ) );
     14                $this->c2 = self::factory()->category->create_and_get(
     15                        array(
     16                                'parent' => $this->c1->term_id,
     17                        )
     18                );
    1719        }
    1820
    … …  
    2224
    2325        public function test_with_default_parameters() {
    24                 $expected = $this->c1->name . '/'. $this->c2->name . '/';
    25                 $found = get_category_parents( $this->c2->term_id );
     26                $expected = $this->c1->name . '/' . $this->c2->name . '/';
     27                $found    = get_category_parents( $this->c2->term_id );
    2628                $this->assertSame( $expected, $found );
    2729        }
    2830
    2931        public function test_link_true() {
    30                 $expected = '<a href="' . get_category_link( $this->c1->term_id ) . '">' . $this->c1->name . '</a>/<a href="' . get_category_link( $this->c2->term_id ) . '">'. $this->c2->name . '</a>/';
    31                 $found = get_category_parents( $this->c2->term_id, true );
     32                $expected = '<a href="' . get_category_link( $this->c1->term_id ) . '">' . $this->c1->name . '</a>/<a href="' . get_category_link( $this->c2->term_id ) . '">' . $this->c2->name . '</a>/';
     33                $found    = get_category_parents( $this->c2->term_id, true );
    3234                $this->assertSame( $expected, $found );
    3335        }
    … …  
    3537        public function test_separator() {
    3638                $expected = $this->c1->name . ' --- ' . $this->c2->name . ' --- ';
    37                 $found = get_category_parents( $this->c2->term_id, false, ' --- ', false );
     39                $found    = get_category_parents( $this->c2->term_id, false, ' --- ', false );
    3840                $this->assertSame( $expected, $found );
    3941        }
    4042
    4143        public function test_nicename_false() {
    42                 $expected = $this->c1->name . '/'. $this->c2->name . '/';
    43                 $found = get_category_parents( $this->c2->term_id, false, '/', false );
     44                $expected = $this->c1->name . '/' . $this->c2->name . '/';
     45                $found    = get_category_parents( $this->c2->term_id, false, '/', false );
    4446                $this->assertSame( $expected, $found );
    4547        }
    4648
    4749        public function test_nicename_true() {
    48                 $expected = $this->c1->slug . '/'. $this->c2->slug . '/';
    49                 $found = get_category_parents( $this->c2->term_id, false, '/', true );
     50                $expected = $this->c1->slug . '/' . $this->c2->slug . '/';
     51                $found    = get_category_parents( $this->c2->term_id, false, '/', true );
    5052                $this->assertSame( $expected, $found );
    5153        }
    … …  
    5860        public function test_category_without_parents() {
    5961                $expected = $this->c1->name . '/';
    60                 $found = get_category_parents( $this->c1->term_id );
     62                $found    = get_category_parents( $this->c1->term_id );
    6163                $this->assertSame( $expected, $found );
    6264        }
Note: See TracChangeset for help on using the changeset viewer.