Make WordPress Core


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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.