From 59b255c445c869be000cfd490e065b0e65b6d343 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Jul 2014 19:44:08 +0000 Subject: [PATCH] URLs in unit tests need to be generated, not hard-coded. See #28706. git-svn-id: https://develop.svn.wordpress.org/trunk@28960 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions/getArchives.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/tests/functions/getArchives.php b/tests/phpunit/tests/functions/getArchives.php index bb6dbd9bd1..e08f930826 100644 --- a/tests/phpunit/tests/functions/getArchives.php +++ b/tests/phpunit/tests/functions/getArchives.php @@ -32,15 +32,19 @@ class Tests_Get_Archives extends WP_UnitTestCase { function test_wp_get_archives_limit() { $ids = array_slice( array_reverse( $this->post_ids ), 0, 5 ); - $expected['limit'] = <<Post title 8 -
  • Post title 7
  • -
  • Post title 6
  • -
  • Post title 5
  • -
  • Post title 4
  • -EOF; - $expected['limit'] = str_replace( '{WP_TESTS_DOMAIN}', WP_TESTS_DOMAIN, $expected['limit'] ); + $link1 = get_permalink( $ids[0] ); + $link2 = get_permalink( $ids[1] ); + $link3 = get_permalink( $ids[2] ); + $link4 = get_permalink( $ids[3] ); + $link5 = get_permalink( $ids[4] ); + $expected['limit'] = <<Post title 8 +
  • Post title 7
  • +
  • Post title 6
  • +
  • Post title 5
  • +
  • Post title 4
  • +EOF; $this->assertEquals( $expected['limit'], trim( wp_get_archives( array( 'echo' => false, 'type' => 'postbypost', 'limit' => 5 ) ) ) ); }