WordPress.org

Make WordPress Core

Changeset 546 in tests


Ignore:
Timestamp:
02/17/12 10:59:15 (2 years ago)
Author:
westi
Message:

Add some more make_clickable tests for bare urls inside html.
These get created when for example autop is run on the content followed by make_clickable in P2
Pre [WP19899] these work. See #WP16892.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r526 r546  
    261261        foreach ($urls_before as $key => $url) { 
    262262            $this->assertEquals($urls_expected[$key], make_clickable($url)); 
     263        } 
     264    } 
     265 
     266    function test_click_inside_html() { 
     267        $urls_before = array( 
     268            '<span>http://example.com</span>', 
     269            '<p>http://example.com/</p>', 
     270        ); 
     271        $urls_expected = array( 
     272            '<span><a href="http://example.com" rel="nofollow">http://example.com</a></span>', 
     273            '<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>', 
     274        ); 
     275        foreach ($urls_before as $key => $url) { 
     276            $this->assertEquals( $urls_expected[$key], make_clickable( $url ) ); 
    263277        } 
    264278    } 
Note: See TracChangeset for help on using the changeset viewer.