Make WordPress Core

Changeset 30515


Ignore:
Timestamp:
11/22/2014 07:53:37 PM (10 years ago)
Author:
boonebgorges
Message:

Improvements to encoded character formatting tests.

In sanitize_title_with_dashes() and sanitize_user() tests, we break large
test methods into smaller ones in order to isolate those that actually describe
the bug being reported in ticket #10823. The unit tests that are continuing to
fail have been attached as a patch to that ticket.

See #30284.

Location:
trunk/tests/phpunit/tests/formatting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php

    r25002 r30515  
    3636    }
    3737
    38     /**
    39      * @ticket 10823
    40      */
    41     function test_strips_entities() {
     38    public function test_strips_nbsp_ndash_and_amp() {
    4239        $this->assertEquals("no-entities-here", sanitize_title_with_dashes("No   Entities – Here &"));
     40    }
     41
     42    public function test_strips_encoded_ampersand() {
    4343        $this->assertEquals("one-two", sanitize_title_with_dashes("One & Two", '', 'save'));
     44    }
     45
     46    public function test_strips_url_encoded_ampersand() {
    4447        $this->assertEquals("one-two", sanitize_title_with_dashes("One { Two;", '', 'save'));
    45         $this->assertEquals("one-two", sanitize_title_with_dashes("One & Two;", '', 'save'));
     48    }
     49
     50    public function test_strips_trademark_symbol() {
    4651        $this->assertEquals("one-two", sanitize_title_with_dashes("One Two™;", '', 'save'));
     52    }
     53
     54    public function test_strips_unencoded_ampersand_followed_by_encoded_ampersand() {
    4755        $this->assertEquals("one-two", sanitize_title_with_dashes("One && Two;", '', 'save'));
     56    }
     57
     58    public function test_strips_unencoded_ampersand_when_not_surrounded_by_spaces() {
    4859        $this->assertEquals("onetwo", sanitize_title_with_dashes("One&Two", '', 'save'));
    49         $this->assertEquals("onetwo-test", sanitize_title_with_dashes("One&Two Test;", '', 'save'));
    5060    }
    5161
  • trunk/tests/phpunit/tests/formatting/SanitizeUser.php

    r25002 r30515  
    1010        $this->assertEquals($expected, sanitize_user($input));
    1111    }
    12     /**
    13      * @ticket 10823
    14      */
    15     function test_strips_entities() {
     12
     13    public function test_strips_encoded_ampersand() {
    1614        $this->assertEquals("ATT", sanitize_user("AT&T"));
     15    }
     16
     17    public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
    1718        $this->assertEquals("ATT Test;", sanitize_user("AT&T Test;"));
    18         $this->assertEquals("AT&T Test;", sanitize_user("AT&T Test;"));
    1919    }
     20
    2021    function test_strips_percent_encoded_octets() {
    2122        $expected = is_multisite() ? 'franois' : 'Franois';
Note: See TracChangeset for help on using the changeset viewer.