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/includes/testcase-rest-post-type-controller.php

    r46586 r47122  
    66        $post_type_obj = get_post_type_object( $post->post_type );
    77
    8         // Standard fields
     8        // Standard fields.
    99        $this->assertEquals( $post->ID, $data['id'] );
    1010        $this->assertEquals( $post->post_name, $data['slug'] );
     
    2626        $this->assertEquals( mysql_to_rfc3339( $post->post_modified ), $data['modified'] );
    2727
    28         // author
     28        // Author.
    2929        if ( post_type_supports( $post->post_type, 'author' ) ) {
    3030            $this->assertEquals( $post->post_author, $data['author'] );
     
    3333        }
    3434
    35         // post_parent
     35        // Post parent.
    3636        if ( $post_type_obj->hierarchical ) {
    3737            $this->assertArrayHasKey( 'parent', $data );
     
    5050        }
    5151
    52         // page attributes
     52        // Page attributes.
    5353        if ( $post_type_obj->hierarchical && post_type_supports( $post->post_type, 'page-attributes' ) ) {
    5454            $this->assertEquals( $post->menu_order, $data['menu_order'] );
     
    5757        }
    5858
    59         // Comments
     59        // Comments.
    6060        if ( post_type_supports( $post->post_type, 'comments' ) ) {
    6161            $this->assertEquals( $post->comment_status, $data['comment_status'] );
     
    111111
    112112        if ( post_type_supports( $post->post_type, 'editor' ) ) {
    113             // TODO: apply content filter for more accurate testing.
     113            // TODO: Apply content filter for more accurate testing.
    114114            if ( ! $post->post_password ) {
    115115                $this->assertEquals( wpautop( $post->post_content ), $data['content']['rendered'] );
     
    127127        if ( post_type_supports( $post->post_type, 'excerpt' ) ) {
    128128            if ( empty( $post->post_password ) ) {
    129                 // TODO: apply excerpt filter for more accurate testing.
     129                // TODO: Apply excerpt filter for more accurate testing.
    130130                $this->assertEquals( wpautop( $post->post_excerpt ), $data['excerpt']['rendered'] );
    131131            } else {
    132                 // TODO: better testing for excerpts for password protected posts.
     132                // TODO: Better testing for excerpts for password protected posts.
    133133            }
    134134            if ( 'edit' === $context ) {
     
    157157        }
    158158
    159         // test links
     159        // Test links.
    160160        if ( $links ) {
    161161
     
    212212        foreach ( $all_data as $data ) {
    213213            $post = get_post( $data['id'] );
    214             // as the links for the post are "response_links" format in the data array we have to pull them
    215             // out and parse them.
     214            // As the links for the post are "response_links" format in the data array,
     215            // we have to pull them out and parse them.
    216216            $links = $data['_links'];
    217217            foreach ( $links as &$links_array ) {
Note: See TracChangeset for help on using the changeset viewer.