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/theme/getThemeStarterContent.php

    r39346 r42343  
    3939         */
    4040        $dehydrated_starter_content = array(
    41             'widgets' => array(
     41            'widgets'     => array(
    4242                'sidebar-1' => array(
    4343                    'text_business_info',
    44                     'text_about' => array(
     44                    'text_about'  => array(
    4545                        'title' => 'Our Story',
    4646                    ),
     
    5353                    'search',
    5454                    'unknown',
    55                     'meta_custom' => array( 'meta', array(
    56                         'title' => 'Pre-hydrated meta widget.',
    57                     ) ),
    58                 ),
    59             ),
    60             'nav_menus' => array(
     55                    'meta_custom' => array(
     56                        'meta',
     57                        array(
     58                            'title' => 'Pre-hydrated meta widget.',
     59                        ),
     60                    ),
     61                ),
     62            ),
     63            'nav_menus'   => array(
    6164                'top' => array(
    62                     'name' => 'Menu Name',
     65                    'name'  => 'Menu Name',
    6366                    'items' => array(
    6467                        'page_home',
     
    8083                        'link_youtube',
    8184                        'link_unknown',
    82                         'link_custom' => array(
     85                        'link_custom'  => array(
    8386                            'title' => 'Custom',
    84                             'url' => 'https://custom.example.com/',
     87                            'url'   => 'https://custom.example.com/',
    8588                        ),
    8689                    ),
    8790                ),
    8891            ),
    89             'posts' => array(
     92            'posts'       => array(
    9093                'home',
    9194                'about',
    9295                'contact',
    93                 'blog' => array(
    94                     'template' => 'blog.php',
     96                'blog'   => array(
     97                    'template'     => 'blog.php',
    9598                    'post_excerpt' => 'Extended',
    9699                ),
     
    99102                'unknown',
    100103                'custom' => array(
    101                     'post_type' => 'post',
     104                    'post_type'  => 'post',
    102105                    'post_title' => 'Custom',
    103                     'thumbnail' => '{{featured-image-logo}}',
     106                    'thumbnail'  => '{{featured-image-logo}}',
    104107                ),
    105108            ),
    106109            'attachments' => array(
    107                 'featured-image-logo' => array(
    108                     'post_title' => 'Title',
     110                'featured-image-logo'    => array(
     111                    'post_title'   => 'Title',
    109112                    'post_content' => 'Description',
    110113                    'post_excerpt' => 'Caption',
    111                     'file' => DIR_TESTDATA . '/images/waffles.jpg',
     114                    'file'         => DIR_TESTDATA . '/images/waffles.jpg',
    112115                ),
    113116                'featured-image-skipped' => array(
     
    115118                ),
    116119            ),
    117             'options' => array(
    118                 'show_on_front' => 'page',
    119                 'page_on_front' => '{{home}}',
     120            'options'     => array(
     121                'show_on_front'  => 'page',
     122                'page_on_front'  => '{{home}}',
    120123                'page_for_posts' => '{{blog}}',
    121124            ),
    122             'theme_mods' => array(
     125            'theme_mods'  => array(
    123126                'panel_1' => '{{homepage-section}}',
    124127                'panel_2' => '{{about}}',
     
    172175    function test_get_theme_starter_content_filter() {
    173176
    174         add_theme_support( 'starter-content',
     177        add_theme_support(
     178            'starter-content',
    175179            array(
    176180                'widgets' => array(
     
    199203        $this->assertInternalType( 'array', $config );
    200204        $this->assertCount( 1, $config['widgets']['sidebar-1'] );
    201         $content['widgets']['sidebar-1'][] = array( 'text', array(
    202             'title' => 'Filtered Widget',
    203             'text'  => 'Custom ',
    204         ) );
     205        $content['widgets']['sidebar-1'][] = array(
     206            'text',
     207            array(
     208                'title' => 'Filtered Widget',
     209                'text'  => 'Custom ',
     210            ),
     211        );
    205212        return $content;
    206213    }
Note: See TracChangeset for help on using the changeset viewer.