WordPress.org

Make WordPress Core

Changeset 213 in tests


Ignore:
Timestamp:
07/31/2008 06:22:48 AM (10 years ago)
Author:
nbachiyski
Message:

Add IRI tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r212 r213  
    4141    // (semi-)colons in URLs with protocol (i.e. http://wordpress.org)
    4242    function test_strip_trailing_with_protocol() {
    43         $this->knownWPBug(5081);
    4443        $urls_before = array(
    4544            'http://wordpress.org/hello.html',
     
    6564    // (semi-)colons in URLs without protocol (i.e. www.wordpress.org)
    6665    function test_strip_trailing_without_protocol() {
    67         $this->knownWPBug(5081);
    6866        $urls_before = array(
    6967            'www.wordpress.org',
     
    7573        $urls_expected = array(
    7674            '<a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>',
    77             'There was a spoon named <a href="http://www.wordpress.org." rel="nofollow">http://www.wordpress.org.</a> Alice!',
     75            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>. Alice!',
    7876            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>, said Alice.',
    7977            'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>; said Alice.',
     
    8179            );
    8280
     81        foreach ($urls_before as $key => $url) {
     82            $this->assertEquals($urls_expected[$key], make_clickable($url));
     83        }
     84    }
     85
     86    function test_iri() {
     87        $this->knownWPBug(4570);
     88        $urls_before = array(
     89            'http://www.詹姆斯.com/',
     90            'http://bg.wikipedia.org/Баба',
     91            'http://example.com/?a=баба&b=дядо',
     92        );
     93        $urls_expected = array(
     94            '<a href="http://www.詹姆斯.com/" rel="nofollow">http://www.詹姆斯.com/</a>',
     95            '<a href="http://bg.wikipedia.org/Баба" rel="nofollow">http://bg.wikipedia.org/Баба</a>',
     96            '<a href="http://example.com/?a=баба&#038;b=дядо" rel="nofollow">http://example.com/?a=баба&#038;b=дядо</a>',
     97        );
    8398        foreach ($urls_before as $key => $url) {
    8499            $this->assertEquals($urls_expected[$key], make_clickable($url));
Note: See TracChangeset for help on using the changeset viewer.