WordPress.org

Make WordPress Core


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

    r46586 r47122  
    3131        $post_id2 = self::factory()->post->create();
    3232
    33         // Basic case
     33        // Basic case.
    3434        $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
    3535
    3636        unset( $GLOBALS['post'] );
    3737
    38         // Global post is not set
     38        // Global post is not set.
    3939        $this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
    4040        $this->assertEquals( '', wp_get_shortlink( 0 ) );
     
    4343        $GLOBALS['post'] = get_post( $post_id );
    4444
    45         // Global post is set
     45        // Global post is set.
    4646        $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0, 'post' ) );
    4747        $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0 ) );
    4848        $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink() );
    4949
    50         // Not the global post
     50        // Not the global post.
    5151        $this->assertEquals( get_permalink( $post_id2 ), wp_get_shortlink( $post_id2, 'post' ) );
    5252
    5353        unset( $GLOBALS['post'] );
    5454
    55         // Global post is not set, once again
     55        // Global post is not set, once again.
    5656        $this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
    5757        $this->assertEquals( '', wp_get_shortlink( 0 ) );
     
    6464        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
    6565
    66         // Global post and permalink structure are set
     66        // Global post and permalink structure are set.
    6767        $GLOBALS['post'] = get_post( $post_id );
    6868        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0, 'post' ) );
     
    7474        $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
    7575
    76         // Basic case
     76        // Basic case.
    7777        // Don't test against get_permalink() since it uses ?page_id= for pages.
    7878        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
Note: See TracChangeset for help on using the changeset viewer.