Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 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/post/objects.php

    r46586 r47122  
    1515        $this->assertEquals( array(), $post->ancestors );
    1616
    17         // Unset and then verify that the magic method fills the property again
     17        // Unset and then verify that the magic method fills the property again.
    1818        unset( $post->ancestors );
    1919        $this->assertEquals( array(), $post->ancestors );
    2020
    21         // Magic get should make meta accessible as properties
     21        // Magic get should make meta accessible as properties.
    2222        add_post_meta( $id, 'test', 'test' );
    2323        $this->assertEquals( 'test', get_post_meta( $id, 'test', true ) );
    2424        $this->assertEquals( 'test', $post->test );
    2525
    26         // Make sure meta does not eclipse true properties
     26        // Make sure meta does not eclipse true properties.
    2727        add_post_meta( $id, 'post_type', 'dummy' );
    2828        $this->assertEquals( 'dummy', get_post_meta( $id, 'post_type', true ) );
    2929        $this->assertEquals( 'post', $post->post_type );
    3030
    31         // Excercise the output argument
     31        // Excercise the output argument.
    3232        $post = get_post( $id, ARRAY_A );
    3333        $this->assertInternalType( 'array', $post );
     
    4545        $this->assertEquals( $id, $post['ID'] );
    4646
    47         // Should default to OBJECT when given invalid output argument
     47        // Should default to OBJECT when given invalid output argument.
    4848        $post = get_post( $id, 'invalid-output-value' );
    4949        $this->assertInstanceOf( 'WP_Post', $post );
    5050        $this->assertEquals( $id, $post->ID );
    5151
    52         // Make sure stdClass in $GLOBALS['post'] is handled
     52        // Make sure stdClass in $GLOBALS['post'] is handled.
    5353        $post_std = $post->to_array();
    5454        $this->assertInternalType( 'array', $post_std );
     
    214214        wp_cache_delete( $id, 'posts' );
    215215
    216         // get_post( stdClass ) should not prime the cache
     216        // get_post( stdClass ) should not prime the cache.
    217217        $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id ) );
    218218        $post = get_post( $post );
    219219        $this->assertEmpty( wp_cache_get( $id, 'posts' ) );
    220220
    221         // get_post( WP_Post ) should not prime the cache
     221        // get_post( WP_Post ) should not prime the cache.
    222222        get_post( $post );
    223223        $this->assertEmpty( wp_cache_get( $id, 'posts' ) );
    224224
    225         // get_post( ID ) should prime the cache
     225        // get_post( ID ) should prime the cache.
    226226        get_post( $post->ID );
    227227        $this->assertNotEmpty( wp_cache_get( $id, 'posts' ) );
Note: See TracChangeset for help on using the changeset viewer.