From 106e1dbedb2b13eba6b03d46c19bb52a7fdf3cdf Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Mon, 16 Jun 2014 15:07:37 +0000 Subject: [PATCH] Use the value of `WP_TESTS_DOMAIN` in some unit tests. props danielhuesken. fixes #28552. git-svn-id: https://develop.svn.wordpress.org/trunk@28757 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions/getArchives.php | 14 ++++++++------ tests/phpunit/tests/user/listAuthors.php | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/tests/functions/getArchives.php b/tests/phpunit/tests/functions/getArchives.php index 5c3491905c..bb6dbd9bd1 100644 --- a/tests/phpunit/tests/functions/getArchives.php +++ b/tests/phpunit/tests/functions/getArchives.php @@ -33,12 +33,14 @@ class Tests_Get_Archives extends WP_UnitTestCase { $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
  • +
  • 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'] ); + $this->assertEquals( $expected['limit'], trim( wp_get_archives( array( 'echo' => false, 'type' => 'postbypost', 'limit' => 5 ) ) ) ); } @@ -82,4 +84,4 @@ EOF; EOF; $this->assertEquals( $expected['order_desc'], trim( wp_get_archives( array( 'echo' => false, 'order' => 'DESC' ) ) ) ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/tests/user/listAuthors.php b/tests/phpunit/tests/user/listAuthors.php index a167277785..030d5f55f8 100644 --- a/tests/phpunit/tests/user/listAuthors.php +++ b/tests/phpunit/tests/user/listAuthors.php @@ -83,20 +83,20 @@ class Tests_User_ListAuthors extends WP_UnitTestCase { } function test_wp_list_authors_feed() { - $expected['feed'] = '
  • bob (link to feed)
  • paul (link to feed)
  • zack (link to feed)
  • '; + $expected['feed'] = '
  • bob (link to feed)
  • paul (link to feed)
  • zack (link to feed)
  • '; $this->AssertEquals( $expected['feed'], wp_list_authors( array( 'echo' => false, 'feed' => 'link to feed' ) ) ); } function test_wp_list_authors_feed_image() { - $expected['feed_image'] = '
  • bob
  • paul
  • zack
  • '; - $this->AssertEquals( $expected['feed_image'], wp_list_authors( array( 'echo' => false, 'feed_image' => 'example.com/path/to/a/graphic.png' ) ) ); + $expected['feed_image'] = '
  • bob
  • paul
  • zack
  • '; + $this->AssertEquals( $expected['feed_image'], wp_list_authors( array( 'echo' => false, 'feed_image' => WP_TESTS_DOMAIN . '/path/to/a/graphic.png' ) ) ); } /** * @ticket 26538 */ function test_wp_list_authors_feed_type() { - $expected['feed_type'] = '
  • bob (link to feed)
  • paul (link to feed)
  • zack (link to feed)
  • '; + $expected['feed_type'] = '
  • bob (link to feed)
  • paul (link to feed)
  • zack (link to feed)
  • '; $this->AssertEquals( $expected['feed_type'], wp_list_authors( array( 'echo' => false, 'feed' => 'link to feed', 'feed_type' => 'atom' ) ) ); } @@ -110,4 +110,4 @@ class Tests_User_ListAuthors extends WP_UnitTestCase { $this->AssertEquals( $expected['html'], wp_list_authors( array( 'echo' => false, 'html' => 0 ) ) ); } -} \ No newline at end of file +}