Changeset 31097
- Timestamp:
- 01/08/2015 06:44:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/link/getAdjacentPostLink.php
r30264 r31097 26 26 public function test_get_next_post_link_default() { 27 27 $actual = get_next_post_link(); 28 $expected = '<a href=" http://example.org/?p=' . $this->post_ids[1]. '" rel="next">Post title 2</a> »';28 $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »'; 29 29 $this->assertSame( $expected, $actual ); 30 30 } … … 32 32 public function test_get_previous_post_link_default() { 33 33 $actual = get_previous_post_link(); 34 $expected = '« <a href=" http://example.org/?p=' . $this->post_ids[3]. '" rel="prev">Post title 4</a>';34 $expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>'; 35 35 $this->assertSame( $expected, $actual ); 36 36 } … … 38 38 public function test_get_next_post_link_same_category() { 39 39 $actual = get_next_post_link( '%link »', '%title', true ); 40 $expected = '<a href=" http://example.org/?p=' . $this->post_ids[1]. '" rel="next">Post title 2</a> »';40 $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »'; 41 41 $this->assertSame( $expected, $actual ); 42 42 } … … 44 44 public function test_get_previous_post_link_same_category() { 45 45 $actual = get_previous_post_link( '« %link', '%title', true ); 46 $expected = '« <a href=" http://example.org/?p=' . $this->post_ids[3]. '" rel="prev">Post title 4</a>';46 $expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>'; 47 47 $this->assertSame( $expected, $actual ); 48 48 } … … 50 50 public function test_get_next_post_link_exclude_category() { 51 51 $actual = get_next_post_link( '%link »', '%title', false, $this->cat_id ); 52 $expected = '<a href=" http://example.org/?p=' . $this->post_ids[1]. '" rel="next">Post title 2</a> »';52 $expected = '<a href="' . home_url( '?p=' . $this->post_ids[1] ) . '" rel="next">Post title 2</a> »'; 53 53 $this->assertSame( $expected, $actual ); 54 54 } … … 56 56 public function test_get_previous_post_link_exclude_category() { 57 57 $actual = get_previous_post_link( '« %link', '%title', false, $this->cat_id ); 58 $expected = '« <a href=" http://example.org/?p=' . $this->post_ids[3]. '" rel="prev">Post title 4</a>';58 $expected = '« <a href="' . home_url( '?p=' . $this->post_ids[3] ) . '" rel="prev">Post title 4</a>'; 59 59 $this->assertSame( $expected, $actual ); 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.