WordPress.org

Make WordPress Core

Changeset 22 in tests


Ignore:
Timestamp:
09/22/07 02:50:38 (8 years ago)
Author:
tellyworth
Message:

add test_strip_ws

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_meta.php

    r1 r22  
    1818} 
    1919 
     20// test helper utility functions 
     21class WPTestUtils extends WPTestCase { 
     22 
     23    function test_strip_ws() { 
     24        $this->assertEquals('', strip_ws('')); 
     25        $this->assertEquals('foo', strip_ws('foo')); 
     26        $this->assertEquals('', strip_ws("\r\n\t  \n\r\t")); 
     27         
     28        $in = <<<EOF 
     29asdf 
     30asdf asdf 
     31asdf     asdf 
     32\tasdf 
     33\tasdf\t 
     34\t\tasdf 
     35foo bar\n\r\n 
     36foo 
     37 
     38EOF; 
     39 
     40        $expected = <<<EOF 
     41asdf 
     42asdf asdf 
     43asdf     asdf 
     44asdf 
     45asdf 
     46asdf 
     47foo bar 
     48foo 
     49EOF; 
     50        $this->assertEquals($expected, strip_ws($in)); 
     51 
     52    } 
     53} 
     54 
    2055?> 
Note: See TracChangeset for help on using the changeset viewer.