Use home_url() instead of hardcoded domain in Tests_Link_GetAdjacentPostLink.
props CalEvans. fixes #30955. git-svn-id: https://develop.svn.wordpress.org/trunk@31097 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
386d0d5fc7
commit
d5b99d560e
@ -25,37 +25,37 @@ class Tests_Link_GetAdjacentPostLink extends WP_UnitTestCase {
|
||||
|
||||
public function test_get_next_post_link_default() {
|
||||
$actual = get_next_post_link();
|
||||
$expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> »';
|
||||
$expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
public function test_get_previous_post_link_default() {
|
||||
$actual = get_previous_post_link();
|
||||
$expected = '« <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
|
||||
$expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
public function test_get_next_post_link_same_category() {
|
||||
$actual = get_next_post_link( '%link »', '%title', true );
|
||||
$expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> »';
|
||||
$expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
public function test_get_previous_post_link_same_category() {
|
||||
$actual = get_previous_post_link( '« %link', '%title', true );
|
||||
$expected = '« <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
|
||||
$expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
public function test_get_next_post_link_exclude_category() {
|
||||
$actual = get_next_post_link( '%link »', '%title', false, $this->cat_id );
|
||||
$expected = '<a href="http://example.org/?p=' . $this->post_ids[1] . '" rel="next">Post title 2</a> »';
|
||||
$expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
public function test_get_previous_post_link_exclude_category() {
|
||||
$actual = get_previous_post_link( '« %link', '%title', false, $this->cat_id );
|
||||
$expected = '« <a href="http://example.org/?p=' . $this->post_ids[3] . '" rel="prev">Post title 4</a>';
|
||||
$expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>';
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user