Make WordPress Core


Ignore:
Timestamp:
10/21/2009 06:39:24 AM (14 years ago)
Author:
westi
Message:

Add tests for make_clicable with brackets in the url.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r239 r250  
    149149            '<a href="http://bg.wikipedia.org/Баба" rel="nofollow">http://bg.wikipedia.org/Баба</a>',
    150150            '<a href="http://example.com/?a=баба&#038;b=дядо" rel="nofollow">http://example.com/?a=баба&#038;b=дядо</a>',
     151        );
     152        foreach ($urls_before as $key => $url) {
     153            $this->assertEquals($urls_expected[$key], make_clickable($url));
     154        }
     155    }
     156   
     157    function test_brackets_in_urls() {
     158            $urls_before = array(
     159            'http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)',
     160            '(http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software))',
     161        );
     162        $urls_expected = array(
     163            '<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>',
     164            '(<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>)',
    151165        );
    152166        foreach ($urls_before as $key => $url) {
Note: See TracChangeset for help on using the changeset viewer.