From c5a336d66409338c44ff7710f74c136ae117a604 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 24 Sep 2015 21:01:10 +0000 Subject: [PATCH] Use `WP_TESTS_DOMAIN` where it should be used in tests in place of hard-coded uses of `example.org`. Also corrects a test value in the data provider for `Tests_Sanitize_Option::test_sanitize_option()` which was only consequentially passing. Fixes #34000 git-svn-id: https://develop.svn.wordpress.org/trunk@34519 602fd350-edb4-49c9-b593-d223f7449a82 --- .../phpunit/tests/option/sanitize-option.php | 2 +- tests/phpunit/tests/term/getEditTermLink.php | 2 +- .../phpunit/tests/term/wpGenerateTagCloud.php | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/tests/option/sanitize-option.php b/tests/phpunit/tests/option/sanitize-option.php index 9c69c0e49a..4dd0942344 100644 --- a/tests/phpunit/tests/option/sanitize-option.php +++ b/tests/phpunit/tests/option/sanitize-option.php @@ -40,7 +40,7 @@ class Tests_Sanitize_Option extends WP_UnitTestCase { array( 'siteurl', 'http://example.org', 'http://example.org' ), array( 'siteurl', 'http://example.org/subdir', 'http://example.org/subdir' ), array( 'siteurl', get_option( 'siteurl' ), '' ), - array( 'home', 'http://example.org', 'example.org' ), + array( 'home', 'http://example.org', 'http://example.org' ), array( 'home', 'https://example.org', 'https://example.org' ), array( 'home', 'http://localhost:8000', 'http://localhost:8000' ), array( 'home', get_option( 'home' ), '' ), diff --git a/tests/phpunit/tests/term/getEditTermLink.php b/tests/phpunit/tests/term/getEditTermLink.php index efc6c0b863..610f24696e 100644 --- a/tests/phpunit/tests/term/getEditTermLink.php +++ b/tests/phpunit/tests/term/getEditTermLink.php @@ -17,7 +17,7 @@ class Tests_Term_GetEditTermLink extends WP_UnitTestCase { ) ); $actual = get_edit_term_link( $term1, 'wptests_tax' ); - $expected = 'http://example.org/wp-admin/edit-tags.php?action=edit&taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post'; + $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/edit-tags.php?action=edit&taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post'; $this->assertEquals( $expected, $actual ); } diff --git a/tests/phpunit/tests/term/wpGenerateTagCloud.php b/tests/phpunit/tests/term/wpGenerateTagCloud.php index 4a931ec4e2..aa8f957db3 100644 --- a/tests/phpunit/tests/term/wpGenerateTagCloud.php +++ b/tests/phpunit/tests/term/wpGenerateTagCloud.php @@ -93,7 +93,7 @@ class Tests_WP_Generate_Tag_Cloud extends WP_UnitTestCase { 'number' => 1, 'hide_empty' => false, ), - "Term 1", + "Term 1", array( 'hide_empty' => false, ), @@ -107,7 +107,7 @@ class Tests_WP_Generate_Tag_Cloud extends WP_UnitTestCase { 'hide_empty' => false, ), array( - "Term 1", + "Term 1", ), array( 'hide_empty' => false, @@ -122,7 +122,7 @@ class Tests_WP_Generate_Tag_Cloud extends WP_UnitTestCase { 'number' => 1, 'hide_empty' => false, ), - "\n", + "\n", array( 'hide_empty' => false, 'format' => 'list', @@ -135,10 +135,10 @@ class Tests_WP_Generate_Tag_Cloud extends WP_UnitTestCase { 'number' => 4, 'hide_empty' => false, ), - "Term 1\n". - "Term 2\n". - "Term 3\n". - "Term 4", + "Term 1\n". + "Term 2\n". + "Term 3\n". + "Term 4", array( 'hide_empty' => false, ), @@ -151,10 +151,10 @@ class Tests_WP_Generate_Tag_Cloud extends WP_UnitTestCase { 'hide_empty' => false, ), "\n", array( 'hide_empty' => false,