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/xmlrpc/wp/getPages.php

    r40417 r42343  
    99
    1010    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    11         self::$post_id = $factory->post->create( array(
    12             'post_type'   => 'page',
    13             'post_author' => $factory->user->create( array(
    14                 'user_login' => 'administrator',
    15                 'user_pass'  => 'administrator',
    16                 'role'       => 'administrator'
    17             ) ),
    18             'post_date'   => strftime( "%Y-%m-%d %H:%M:%S", strtotime( '+1 day' ) ),
    19         ) );
    20         self::$editor_id = $factory->user->create( array(
    21             'user_login' => 'editor',
    22             'user_pass'  => 'editor',
    23             'role'       => 'editor'
    24         ) );
     11        self::$post_id   = $factory->post->create(
     12            array(
     13                'post_type'   => 'page',
     14                'post_author' => $factory->user->create(
     15                    array(
     16                        'user_login' => 'administrator',
     17                        'user_pass'  => 'administrator',
     18                        'role'       => 'administrator',
     19                    )
     20                ),
     21                'post_date'   => strftime( '%Y-%m-%d %H:%M:%S', strtotime( '+1 day' ) ),
     22            )
     23        );
     24        self::$editor_id = $factory->user->create(
     25            array(
     26                'user_login' => 'editor',
     27                'user_pass'  => 'editor',
     28                'role'       => 'editor',
     29            )
     30        );
    2531    }
    2632
     
    4349        $this->assertNotIXRError( $results );
    4450
    45         foreach( $results as $result ) {
     51        foreach ( $results as $result ) {
    4652            $page = get_post( $result['page_id'] );
    4753            $this->assertEquals( $page->post_type, 'page' );
     
    6369     */
    6470    function test_semi_capable_user() {
    65         add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap') , 10, 4 );
     71        add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap' ), 10, 4 );
    6672
    6773        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) );
     
    6975
    7076        $found_incapable = false;
    71         foreach( $results as $result ) {
     77        foreach ( $results as $result ) {
    7278            // WP#20629
    7379            $this->assertNotIXRError( $result );
Note: See TracChangeset for help on using the changeset viewer.