Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 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/rest-api/rest-categories-controller.php

    r47118 r47122  
    114114
    115115    public function test_context_param() {
    116         // Collection
     116        // Collection.
    117117        $request  = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories' );
    118118        $response = rest_get_server()->dispatch( $request );
     
    120120        $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
    121121        $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
    122         // Single
     122        // Single.
    123123        $category1 = $this->factory->category->create( array( 'name' => 'Season 5' ) );
    124124        $request   = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories/' . $category1 );
     
    442442        $this->assertEquals( 3, count( $data ) );
    443443
    444         // Check ordered by name by default
     444        // Check ordered by name by default.
    445445        $names = wp_list_pluck( $data, 'name' );
    446446        $this->assertEquals( array( 'DC', 'Image', 'Marvel' ), $names );
     
    450450        $post_id = $this->post_with_categories();
    451451
    452         // Regular request
     452        // Regular request.
    453453        $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
    454454        $request->set_param( 'post', $post_id );
     
    462462        $this->assertEquals( array( 'Image', 'Marvel', 'DC' ), $names, 'Terms should be ordered by description' );
    463463
    464         // Flip the order
     464        // Flip the order.
    465465        $request->set_param( 'order', 'desc' );
    466466        $response = rest_get_server()->dispatch( $request );
Note: See TracChangeset for help on using the changeset viewer.