Make WordPress Core

Changeset 313 in tests


Ignore:
Timestamp:
10/31/2010 08:50:16 AM (13 years ago)
Author:
westi
Message:

Add tests for twitter hash bang urls from #WP14993.
Start merging extra make_clickable tests. See #8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r312 r313  
    7272            'There was a spoon named http://wordpress.org;',
    7373            'There was a spoon named http://wordpress.org:',
    74             'There was a spoon named (http://wordpress.org)'
     74            'There was a spoon named (http://wordpress.org)',
     75            'There was a spoon named (http://wordpress.org)x',
    7576            );
    7677        $urls_expected = array(
     
    8081            'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>;',
    8182            'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>:',
    82             'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>)'
     83            'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>)',
     84            'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>)x',
    8385            );
    8486
     
    162164            'blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software) blah',
    163165            'blah (http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah',
    164             );
     166            'blah blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software) blah blah',
     167            'blah blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah blah',
     168            'blah blah (http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah blah',
     169            'blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software).) blah blah',
     170            'blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software).)moreurl blah blah',
     171        );
    165172        $urls_expected = array(
    166173            '<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>',
     
    168175            'blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a> blah',
    169176            'blah (<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah',
     177            'blah blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a> blah blah',
     178            'blah blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah blah',
     179            'blah blah (<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah blah',
     180            'blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>.) blah blah',
     181            'blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>.)moreurl blah blah',     
    170182        );
    171183        foreach ($urls_before as $key => $url) {
     
    192204    }
    193205
     206    function test_twitter_hash_bang() {
     207        $this->knownWPBug(14993);
     208            $urls_before = array(
     209            'http://twitter.com/#!/wordpress/status/25907440233',
     210        );
     211        $urls_expected = array(
     212            '<a href="http://twitter.com/#!/wordpress/status/25907440233" rel="nofollow">http://twitter.com/#!/wordpress/status/25907440233</a>',
     213        );
     214        foreach ($urls_before as $key => $url) {
     215            $this->assertEquals($urls_expected[$key], make_clickable($url));
     216        }
     217    }
    194218}
    195219
Note: See TracChangeset for help on using the changeset viewer.