WordPress.org

Make WordPress Core

Changeset 34519


Ignore:
Timestamp:
09/24/2015 09:01:10 PM (6 years ago)
Author:
johnbillion
Message:

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

Location:
trunk/tests/phpunit/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/sanitize-option.php

    r33907 r34519  
    4141            array( 'siteurl', 'http://example.org/subdir', 'http://example.org/subdir' ),
    4242            array( 'siteurl', get_option( 'siteurl' ), '' ),
    43             array( 'home', 'http://example.org', 'example.org' ),
     43            array( 'home', 'http://example.org', 'http://example.org' ),
    4444            array( 'home', 'https://example.org', 'https://example.org' ),
    4545            array( 'home', 'http://localhost:8000', 'http://localhost:8000' ),
  • trunk/tests/phpunit/tests/term/getEditTermLink.php

    r32954 r34519  
    1818
    1919        $actual = get_edit_term_link( $term1, 'wptests_tax' );
    20         $expected = 'http://example.org/wp-admin/edit-tags.php?action=edit&taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post';
     20        $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/edit-tags.php?action=edit&taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post';
    2121        $this->assertEquals( $expected, $actual );
    2222    }
  • trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php

    r32996 r34519  
    9494                    'hide_empty' => false,
    9595                ),
    96                 "<a href='http://example.org/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>",
     96                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>",
    9797                array(
    9898                    'hide_empty' => false,
     
    108108                ),
    109109                array(
    110                     "<a href='http://example.org/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>",
     110                    "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>",
    111111                ),
    112112                array(
     
    123123                    'hide_empty' => false,
    124124                ),
    125                 "<ul class='wp-tag-cloud'>\n\t<li><a href='http://example.org/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a></li>\n</ul>\n",
     125                "<ul class='wp-tag-cloud'>\n\t<li><a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a></li>\n</ul>\n",
    126126                array(
    127127                    'hide_empty' => false,
     
    136136                    'hide_empty' => false,
    137137                ),
    138                 "<a href='http://example.org/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>\n".
    139                 "<a href='http://example.org/?tag=term-2' class='tag-link-1' title='0 topics' style='font-size: 8pt;'>Term 2</a>\n".
    140                 "<a href='http://example.org/?tag=term-3' class='tag-link-2' title='0 topics' style='font-size: 8pt;'>Term 3</a>\n".
    141                 "<a href='http://example.org/?tag=term-4' class='tag-link-3' title='0 topics' style='font-size: 8pt;'>Term 4</a>",
     138                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a>\n".
     139                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-2' class='tag-link-1' title='0 topics' style='font-size: 8pt;'>Term 2</a>\n".
     140                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-3' class='tag-link-2' title='0 topics' style='font-size: 8pt;'>Term 3</a>\n".
     141                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-4' class='tag-link-3' title='0 topics' style='font-size: 8pt;'>Term 4</a>",
    142142                array(
    143143                    'hide_empty' => false,
     
    152152                ),
    153153                "<ul class='wp-tag-cloud'>\n\t<li>".
    154                 "<a href='http://example.org/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a></li>\n\t<li>".
    155                 "<a href='http://example.org/?tag=term-2' class='tag-link-1' title='0 topics' style='font-size: 8pt;'>Term 2</a></li>\n\t<li>".
    156                 "<a href='http://example.org/?tag=term-3' class='tag-link-2' title='0 topics' style='font-size: 8pt;'>Term 3</a></li>\n\t<li>".
    157                 "<a href='http://example.org/?tag=term-4' class='tag-link-3' title='0 topics' style='font-size: 8pt;'>Term 4</a>".
     154                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-1' class='tag-link-0' title='0 topics' style='font-size: 8pt;'>Term 1</a></li>\n\t<li>".
     155                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-2' class='tag-link-1' title='0 topics' style='font-size: 8pt;'>Term 2</a></li>\n\t<li>".
     156                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-3' class='tag-link-2' title='0 topics' style='font-size: 8pt;'>Term 3</a></li>\n\t<li>".
     157                "<a href='http://" . WP_TESTS_DOMAIN . "/?tag=term-4' class='tag-link-3' title='0 topics' style='font-size: 8pt;'>Term 4</a>".
    158158                "</li>\n</ul>\n",
    159159                array(
Note: See TracChangeset for help on using the changeset viewer.