Make WordPress Core

Changeset 31097


Ignore:
Timestamp:
01/08/2015 06:44:18 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Use home_url() instead of hardcoded domain in Tests_Link_GetAdjacentPostLink.

props CalEvans.
fixes #30955.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/link/getAdjacentPostLink.php

    r30264 r31097  
    2626    public function test_get_next_post_link_default() {
    2727        $actual = get_next_post_link();
    28         $expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> &raquo;';
     28        $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> &raquo;';
    2929        $this->assertSame( $expected, $actual );
    3030    }
     
    3232    public function test_get_previous_post_link_default() {
    3333        $actual = get_previous_post_link();
    34         $expected = '&laquo; <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
     34        $expected = '&laquo; <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
    3535        $this->assertSame( $expected, $actual );
    3636    }
     
    3838    public function test_get_next_post_link_same_category() {
    3939        $actual = get_next_post_link( '%link &raquo;', '%title', true );
    40         $expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> &raquo;';
     40        $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> &raquo;';
    4141        $this->assertSame( $expected, $actual );
    4242    }
     
    4444    public function test_get_previous_post_link_same_category() {
    4545        $actual = get_previous_post_link( '&laquo; %link', '%title', true );
    46         $expected = '&laquo; <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
     46        $expected = '&laquo; <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
    4747        $this->assertSame( $expected, $actual );
    4848    }
     
    5050    public function test_get_next_post_link_exclude_category() {
    5151        $actual = get_next_post_link( '%link &raquo;', '%title', false, $this->cat_id );
    52         $expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> &raquo;';
     52        $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> &raquo;';
    5353        $this->assertSame( $expected, $actual );
    5454    }
     
    5656    public function test_get_previous_post_link_exclude_category() {
    5757        $actual = get_previous_post_link( '&laquo; %link', '%title', false, $this->cat_id );
    58         $expected = '&laquo; <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
     58        $expected = '&laquo; <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
    5959        $this->assertSame( $expected, $actual );
    6060    }
Note: See TracChangeset for help on using the changeset viewer.