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

    r41174 r42343  
    298298        global $wp;
    299299
    300         register_post_type( 'foo', array(
    301             'public'    => true,
    302             'query_var' => 'bar',
    303         ) );
     300        register_post_type(
     301            'foo', array(
     302                'public'    => true,
     303                'query_var' => 'bar',
     304            )
     305        );
    304306
    305307        $this->assertInternalType( 'int', array_search( 'bar', $wp->public_query_vars ) );
     
    316318        global $wp_rewrite;
    317319
    318         register_post_type( 'foo', array(
    319             'public'    => true,
    320             'query_var' => 'bar',
    321         ) );
     320        register_post_type(
     321            'foo', array(
     322                'public'    => true,
     323                'query_var' => 'bar',
     324            )
     325        );
    322326
    323327        $count_before = count( $wp_rewrite->rewritereplace );
     
    339343        global $wp_rewrite;
    340344
    341         register_post_type( 'foo', array(
    342             'public'      => true,
    343             'has_archive' => true,
    344         ) );
     345        register_post_type(
     346            'foo', array(
     347                'public'      => true,
     348                'has_archive' => true,
     349            )
     350        );
    345351
    346352        $this->assertContains( 'index.php?post_type=foo', $wp_rewrite->extra_rules_top );
     
    355361        global $post_type_meta_caps;
    356362
    357         register_post_type( 'foo', array(
    358             'public'          => true,
    359             'capability_type' => 'bar',
    360             'map_meta_cap' => true,
    361         ) );
     363        register_post_type(
     364            'foo', array(
     365                'public'          => true,
     366                'capability_type' => 'bar',
     367                'map_meta_cap'    => true,
     368            )
     369        );
    362370
    363371        $this->assertSame( 'read_post', $post_type_meta_caps['read_bar'] );
     
    378386        global $_wp_post_type_features;
    379387
    380         register_post_type( 'foo', array(
    381             'public'   => true,
    382             'supports' => array( 'editor', 'author', 'title' ),
    383         ) );
     388        register_post_type(
     389            'foo', array(
     390                'public'   => true,
     391                'supports' => array( 'editor', 'author', 'title' ),
     392            )
     393        );
    384394
    385395        $this->assertEqualSetsWithIndex(
     
    401411        global $wp_taxonomies;
    402412
    403         register_post_type( 'foo', array(
    404             'public'     => true,
    405             'taxonomies' => array( 'category', 'post_tag' ),
    406         ) );
     413        register_post_type(
     414            'foo', array(
     415                'public'     => true,
     416                'taxonomies' => array( 'category', 'post_tag' ),
     417            )
     418        );
    407419
    408420        $this->assertInternalType( 'int', array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );
     
    420432        global $wp_filter;
    421433
    422         register_post_type( 'foo', array(
    423             'public' => true,
    424         ) );
     434        register_post_type(
     435            'foo', array(
     436                'public' => true,
     437            )
     438        );
    425439
    426440        $this->assertArrayHasKey( 'future_foo', $wp_filter );
     
    436450        global $wp_filter;
    437451
    438         register_post_type( 'foo', array(
    439             'public'               => true,
    440             'register_meta_box_cb' => '__return_empty_string',
    441         ) );
     452        register_post_type(
     453            'foo', array(
     454                'public'               => true,
     455                'register_meta_box_cb' => '__return_empty_string',
     456            )
     457        );
    442458
    443459        $this->assertArrayHasKey( 'add_meta_boxes_foo', $wp_filter );
     
    453469        global $wp_post_types;
    454470
    455         register_post_type( 'foo', array(
    456             'public' => true,
    457         ) );
     471        register_post_type(
     472            'foo', array(
     473                'public' => true,
     474            )
     475        );
    458476
    459477        $this->assertInternalType( 'object', $wp_post_types['foo'] );
     
    470488     */
    471489    public function test_post_type_does_not_exist_after_unregister_post_type() {
    472         register_post_type( 'foo', array(
    473             'public' => true,
    474         ) );
     490        register_post_type(
     491            'foo', array(
     492                'public' => true,
     493            )
     494        );
    475495
    476496        $this->assertTrue( unregister_post_type( 'foo' ) );
Note: See TracChangeset for help on using the changeset viewer.