WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (3 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/customize/panel.php

    r35242 r42343  
    1717        require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
    1818        $GLOBALS['wp_customize'] = new WP_Customize_Manager();
    19         $this->manager = $GLOBALS['wp_customize'];
    20         $this->undefined = new stdClass();
     19        $this->manager           = $GLOBALS['wp_customize'];
     20        $this->undefined         = new stdClass();
    2121    }
    2222
     
    5050    function test_construct_custom_args() {
    5151        $args = array(
    52             'priority' => 200,
    53             'capability' => 'edit_posts',
    54             'theme_supports' => 'html5',
    55             'title' => 'Hello World',
    56             'description' => 'Lorem Ipsum',
    57             'type' => 'horizontal',
     52            'priority'        => 200,
     53            'capability'      => 'edit_posts',
     54            'theme_supports'  => 'html5',
     55            'title'           => 'Hello World',
     56            'description'     => 'Lorem Ipsum',
     57            'type'            => 'horizontal',
    5858            'active_callback' => '__return_true',
    5959        );
     
    8181        $this->assertTrue( $panel->active() );
    8282
    83         $panel = new WP_Customize_Panel( $this->manager, 'foo', array(
    84             'active_callback' => '__return_false',
    85         ) );
     83        $panel = new WP_Customize_Panel(
     84            $this->manager, 'foo', array(
     85                'active_callback' => '__return_false',
     86            )
     87        );
    8688        $this->assertFalse( $panel->active() );
    8789        add_filter( 'customize_panel_active', array( $this, 'filter_active_test' ), 10, 2 );
     
    105107     */
    106108    function test_json() {
    107         $args = array(
    108             'priority' => 200,
    109             'capability' => 'edit_posts',
    110             'theme_supports' => 'html5',
    111             'title' => 'Hello World',
    112             'description' => 'Lorem Ipsum',
    113             'type' => 'horizontal',
     109        $args  = array(
     110            'priority'        => 200,
     111            'capability'      => 'edit_posts',
     112            'theme_supports'  => 'html5',
     113            'title'           => 'Hello World',
     114            'description'     => 'Lorem Ipsum',
     115            'type'            => 'horizontal',
    114116            'active_callback' => '__return_true',
    115117        );
    116118        $panel = new WP_Customize_Panel( $this->manager, 'foo', $args );
    117         $data = $panel->json();
     119        $data  = $panel->json();
    118120        $this->assertEquals( 'foo', $data['id'] );
    119121        foreach ( array( 'title', 'description', 'priority', 'type' ) as $key ) {
     
    134136        $panel = new WP_Customize_Panel( $this->manager, 'foo' );
    135137        $this->assertTrue( $panel->check_capabilities() );
    136         $old_cap = $panel->capability;
     138        $old_cap           = $panel->capability;
    137139        $panel->capability = 'do_not_allow';
    138140        $this->assertFalse( $panel->check_capabilities() );
     
    156158    function test_maybe_render() {
    157159        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    158         $panel = new WP_Customize_Panel( $this->manager, 'bar' );
     160        $panel                        = new WP_Customize_Panel( $this->manager, 'bar' );
    159161        $customize_render_panel_count = did_action( 'customize_render_panel' );
    160162        add_action( 'customize_render_panel', array( $this, 'action_customize_render_panel_test' ) );
Note: See TracChangeset for help on using the changeset viewer.