WordPress.org

Make WordPress Core

Changeset 489 in tests


Ignore:
Timestamp:
12/18/11 00:48:51 (2 years ago)
Author:
dd32
Message:

Cover more entity striping cases for sanitize_user() and sanitize_title_with_dashes(); See http://core.trac.wordpress.org/ticket/10823

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r486 r489  
    816816    function test_strips_entities() { 
    817817        $this->assertEquals("ATT", sanitize_user("AT&T")); 
     818        $this->assertEquals("ATT Test;", sanitize_user("AT&T Test;")); 
     819        $this->assertEquals("AT&T Test;", sanitize_user("AT&T Test;")); 
    818820    } 
    819821    function test_strips_percent_encoded_octets() { 
     
    931933        $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just a ° Slug", '', 'save')); 
    932934        $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just ™ a Slug", '', 'save')); 
     935    } 
     936 
     937    function test_strips_entities() { 
     938        $this->assertEquals("one-two", sanitize_title_with_dashes("One & Two", '', 'save')); 
     939        $this->assertEquals("one-two", sanitize_title_with_dashes("One { Two;", '', 'save')); 
     940        $this->assertEquals("one-two", sanitize_title_with_dashes("One & Two;", '', 'save')); 
     941        $this->assertEquals("one-two", sanitize_title_with_dashes("One Two™;", '', 'save')); 
     942        $this->assertEquals("one-two", sanitize_title_with_dashes("One && Two;", '', 'save')); 
     943        $this->assertEquals("onetwo", sanitize_title_with_dashes("One&Two", '', 'save')); 
     944        $this->assertEquals("onetwo-test", sanitize_title_with_dashes("One&Two Test;", '', 'save')); 
    933945    } 
    934946} 
Note: See TracChangeset for help on using the changeset viewer.