WordPress.org

Make WordPress Core

Changeset 725 in tests


Ignore:
Timestamp:
05/29/12 14:01:12 (23 months ago)
Author:
westi
Message:

Add some simple make_clickable test cases for urls where the user has not already encoded the square brackets in the url. See #WP16859.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r724 r725  
    316316        if ( version_compare( $GLOBALS['wp_version'], '3.4-alpha', '>=' ) ) 
    317317            $this->assertEquals( $in, $out ); 
     318    } 
     319 
     320    function test_square_brackets() { 
     321        $this->knownWPBug( 16859 ); 
     322        $urls_before = array( 
     323            'http://example.com/?foo[bar]=baz', 
     324            'http://example.com/?baz=bar&foo[bar]=baz', 
     325        ); 
     326        $urls_expected = array( 
     327            '<a href="http://example.com/?foo%5Bbar%5D=baz" rel="nofollow">http://example.com/?foo%5Bbar%5D=baz</a>', 
     328            '<a href="http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz" rel="nofollow">http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz</a>', 
     329        ); 
     330        foreach ($urls_before as $key => $url) { 
     331            $this->assertEquals( $urls_expected[$key], make_clickable( $url ) ); 
     332        } 
     333 
    318334    } 
    319335} 
Note: See TracChangeset for help on using the changeset viewer.