Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php

    r46586 r47122  
    6565                        );
    6666                }
    67                 // get them all
     67                // Get them all.
    6868                $filter  = array(
    6969                        'post_type' => $cpt_name,
    … …  
    7474                $this->assertEquals( $num_posts, count( $results ) );
    7575
    76                 // page through results
     76                // Page through results.
    7777                $posts_found      = array();
    7878                $filter['number'] = 2;
    … …  
    8383                        $filter['offset'] += $filter['number'];
    8484                } while ( count( $presults ) > 0 );
    85                 // verify that $post_ids matches $posts_found
     85                // Verify that $post_ids matches $posts_found.
    8686                $this->assertEquals( 0, count( array_diff( $post_ids, $posts_found ) ) );
    8787
    88                 // add comments to some of the posts
     88                // Add comments to some of the posts.
    8989                foreach ( $post_ids as $key => $post_id ) {
    9090                        // Larger post IDs will get more comments.
    … …  
    9292                }
    9393
    94                 // get results ordered by comment count
     94                // Get results ordered by comment count.
    9595                $filter2  = array(
    9696                        'post_type' => $cpt_name,
    … …  
    108108                }
    109109
    110                 // set one of the posts to draft and get drafts
     110                // Set one of the posts to draft and get drafts.
    111111                $post              = get_post( $post_ids[0] );
    112112                $post->post_status = 'draft';
    … …  
    128128                self::factory()->post->create();
    129129
    130                 // check default fields
     130                // Check default fields.
    131131                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
    132132                $this->assertNotIXRError( $results );
    133                 $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // subset of expected fields
     133                $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // Subset of expected fields.
    134134                foreach ( $expected_fields as $field ) {
    135135                        $this->assertArrayHasKey( $field, $results[0] );
    136136                }
    137137
    138                 // request specific fields and verify that only those are returned
     138                // Request specific fields and verify that only those are returned.
    139139                $filter   = array();
    140140                $fields   = array( 'post_name', 'post_author', 'enclosure' );
    … …  
    156156                $post_ids[] = self::factory()->post->create( array( 'post_title' => 'Second: Hello, World!' ) );
    157157
    158                 // Search for none of them
     158                // Search for none of them.
    159159                $filter  = array( 's' => 'Third' );
    160160                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
    … …  
    162162                $this->assertEquals( 0, count( $results ) );
    163163
    164                 // Search for one of them
     164                // Search for one of them.
    165165                $filter  = array( 's' => 'First:' );
    166166                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
Note: See TracChangeset for help on using the changeset viewer.