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/url.php

    r46586 r47122  
    11<?php
    22
    3 // tests for link-template.php and related URL functions
    43/**
     4 * Tests for link-template.php and related URL functions.
     5 *
    56 * @group url
    67 */
     
    201202        $screen = get_current_screen();
    202203
    203         // Pretend to be in the site admin
     204        // Pretend to be in the site admin.
    204205        set_current_screen( 'dashboard' );
    205206        $home = get_option( 'home' );
    206207
    207         // home_url() should return http when in the admin
     208        // home_url() should return http when in the admin.
    208209        $_SERVER['HTTPS'] = 'on';
    209210        $this->assertEquals( $home, home_url() );
     
    212213        $this->assertEquals( $home, home_url() );
    213214
    214         // If not in the admin, is_ssl() should determine the scheme
     215        // If not in the admin, is_ssl() should determine the scheme.
    215216        set_current_screen( 'front' );
    216217        $this->assertEquals( $home, home_url() );
     
    219220        $this->assertEquals( $home, home_url() );
    220221
    221         // Test with https in home
     222        // Test with https in home.
    222223        update_option( 'home', set_url_scheme( $home, 'https' ) );
    223224
    224         // Pretend to be in the site admin
     225        // Pretend to be in the site admin.
    225226        set_current_screen( 'dashboard' );
    226227        $home = get_option( 'home' );
    227228
    228         // home_url() should return whatever scheme is set in the home option when in the admin
     229        // home_url() should return whatever scheme is set in the home option when in the admin.
    229230        $_SERVER['HTTPS'] = 'on';
    230231        $this->assertEquals( $home, home_url() );
     
    233234        $this->assertEquals( $home, home_url() );
    234235
    235         // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home
     236        // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home.
    236237        set_current_screen( 'front' );
    237238        $this->assertEquals( $home, home_url() );
     
    249250        $screen = get_current_screen();
    250251
    251         // Pretend to be in the site admin
     252        // Pretend to be in the site admin.
    252253        set_current_screen( 'dashboard' );
    253254        $home = network_home_url();
    254255
    255         // home_url() should return http when in the admin
     256        // home_url() should return http when in the admin.
    256257        $this->assertEquals( 0, strpos( $home, 'http://' ) );
    257258        $_SERVER['HTTPS'] = 'on';
     
    261262        $this->assertEquals( $home, network_home_url() );
    262263
    263         // If not in the admin, is_ssl() should determine the scheme
     264        // If not in the admin, is_ssl() should determine the scheme.
    264265        set_current_screen( 'front' );
    265266        $this->assertEquals( $home, network_home_url() );
     
    350351        $this->assertEquals( $post_id, $p->ID );
    351352
    352         // The same again to make sure a cached query returns the same result
     353        // The same again to make sure a cached query returns the same result.
    353354        $p = get_adjacent_post();
    354355        $this->assertInstanceOf( 'WP_Post', $p );
    355356        $this->assertEquals( $post_id, $p->ID );
    356357
    357         // Test next
     358        // Test next.
    358359        $p = get_adjacent_post( false, '', false );
    359360        $this->assertEquals( '', $p );
Note: See TracChangeset for help on using the changeset viewer.