WordPress.org

Make WordPress Core

Changeset 204 in tests


Ignore:
Timestamp:
04/24/08 13:11:45 (7 years ago)
Author:
tellyworth
Message:

split the utf8 tests; more shortcode cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_shortcode.php

    r203 r204  
    2020// [baztag]content[/baztag] 
    2121function baztag_func($atts, $content='') { 
    22     return "content = $content"; 
     22    return 'content = '.do_shortcode($content); 
    2323} 
    2424add_shortcode('baztag', 'baztag_func'); 
     
    132132    } 
    133133     
     134    function test_nested_tags() { 
     135        $out = do_shortcode('[baztag][dumptag abc="foo" def=123 http://wordpress.com/][/baztag]'); 
     136        $expected = <<<EOF 
     137content = abc = foo 
     138def = 123 
     1390 = http://wordpress.com 
     140 
     141EOF; 
     142        $this->assertEquals($expected, $out); 
     143    } 
     144     
    134145    function test_tag_escaped() { 
    135146        $this->knownWPBug(6518); 
     
    195206 
    196207 
    197 foo = 1 content =  [footag foo="2"] [baztag] 
    198  
    199 [baztag] 
     208foo = 1 content =  foo = 2 content = 
     209content = 
    200210more content 
    201211 
     
    205215    } 
    206216     
    207     function test_utf8_whitespace() { 
     217    function test_utf8_whitespace_1() { 
    208218        // see http://trac.wordpress.org/ticket/6562 
    209         do_shortcode("[test-shortcode-tag foo=\"bar\" \x00\xA0baz=\"123\" \x20\x0babc=\"def\"]"); 
    210         $this->assertEquals( array('foo' => 'bar', 'baz' => '123', 'abc' => 'def'), $this->atts ); 
     219        do_shortcode("[test-shortcode-tag foo=\"bar\" \x00\xA0baz=\"123\"]"); 
     220        $this->assertEquals( array('foo' => 'bar', 'baz' => '123'), $this->atts ); 
    211221        $this->assertEquals( '', $this->content ); 
    212          
     222    } 
     223 
     224    function test_utf8_whitespace_2() { 
     225        // see http://trac.wordpress.org/ticket/6562 
     226        do_shortcode("[test-shortcode-tag foo=\"bar\" \x20\x0babc=\"def\"]"); 
     227        $this->assertEquals( array('foo' => 'bar', 'abc' => 'def'), $this->atts ); 
     228        $this->assertEquals( '', $this->content ); 
    213229    } 
    214230 
Note: See TracChangeset for help on using the changeset viewer.