WordPress.org

Make WordPress Core


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

    r40417 r42343  
    4545    function test_invalid_role() {
    4646        $administrator_id = $this->make_user_by_role( 'administrator' );
    47         if ( is_multisite() )
     47        if ( is_multisite() ) {
    4848            grant_super_admin( $administrator_id );
     49        }
    4950
    50         $filter = array( 'role' => 'invalidrole' );
     51        $filter  = array( 'role' => 'invalidrole' );
    5152        $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    5253        $this->assertIXRError( $results );
     
    5556
    5657    function test_role_filter() {
    57         $author_id = $this->make_user_by_role( 'author' );
    58         $editor_id = $this->make_user_by_role( 'editor' );
     58        $author_id        = $this->make_user_by_role( 'author' );
     59        $editor_id        = $this->make_user_by_role( 'editor' );
    5960        $administrator_id = $this->make_user_by_role( 'administrator' );
    60         if ( is_multisite() )
     61        if ( is_multisite() ) {
    6162            grant_super_admin( $administrator_id );
     63        }
    6264
    6365        // test a single role ('editor')
    64         $filter = array( 'role' => 'editor' );
     66        $filter  = array( 'role' => 'editor' );
    6567        $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    6668        $this->assertNotIXRError( $results );
     
    6971
    7072        // test 'authors', which should return all non-subscribers
    71         $filter2 = array( 'who' => 'authors' );
     73        $filter2  = array( 'who' => 'authors' );
    7274        $results2 = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter2 ) );
    7375        $this->assertNotIXRError( $results2 );
     
    7779    function test_paging_filters() {
    7880        $administrator_id = $this->make_user_by_role( 'administrator' );
    79         if ( is_multisite() )
     81        if ( is_multisite() ) {
    8082            grant_super_admin( $administrator_id );
     83        }
    8184
    8285        self::factory()->user->create_many( 5 );
     
    8588
    8689        $users_found = array();
    87         $page_size = 2;
     90        $page_size   = 2;
    8891
    89         $filter = array( 'number' => $page_size, 'offset' => 0 );
     92        $filter = array(
     93            'number' => $page_size,
     94            'offset' => 0,
     95        );
    9096        do {
    9197            $presults = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
     
    103109        $this->make_user_by_role( 'administrator' );
    104110
    105         $filter = array( 'orderby' => 'email', 'order' => 'ASC' );
     111        $filter  = array(
     112            'orderby' => 'email',
     113            'order'   => 'ASC',
     114        );
    106115        $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    107116        $this->assertNotIXRError( $results );
Note: See TracChangeset for help on using the changeset viewer.