Make WordPress Core

Changeset 407 in tests for wp-testcase/test_post_filtering.php


Ignore:
Timestamp:
08/04/2011 08:38:26 PM (15 years ago)
Author:
ryan
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_post_filtering.php

    r366 r407  
    1010                update_option('use_balanceTags', 1);
    1111                kses_init_filters();
    12                
    13         }
    14        
     12
     13        }
     14
    1515        function tearDown() {
    1616                parent::tearDown();
    1717                kses_remove_filters();
    1818        }
    19        
     19
    2020        function _insert_quick_post($title, $content, $more=array()) {
    2121                return $this->post_ids[] = wp_insert_post(array_merge(array(
     
    2626                        ), $more));
    2727        }
    28        
     28
    2929        // a simple test to make sure unclosed tags are fixed
    3030        function test_post_content_unknown_tag() {
    31                
     31
    3232                $content = <<<EOF
    3333<foobar>no such tag</foobar>
     
    4040                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    4141                $post = get_post($id);
    42                
    43                 $this->assertEquals( $expected, $post->post_content );
    44         }
    45        
     42
     43                $this->assertEquals( $expected, $post->post_content );
     44        }
     45
    4646        // a simple test to make sure unbalanced tags are fixed
    4747        function test_post_content_unbalanced_tag() {
    48                
     48
    4949                $content = <<<EOF
    5050<i>italics
     
    5757                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    5858                $post = get_post($id);
    59                
     59
    6060                $this->assertEquals( $expected, $post->post_content );
    6161        }
     
    6363        // test kses filtering of disallowed attribute
    6464        function test_post_content_disallowed_attr() {
    65                
     65
    6666                $content = <<<EOF
    6767<img src='foo' width='500' href='shlorp' />
     
    7474                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    7575                $post = get_post($id);
    76                
     76
    7777                $this->assertEquals( $expected, $post->post_content );
    7878        }
     
    8181        // empty element
    8282        function test_post_content_xhtml_empty_elem() {
    83                 $this->knownWPBug( 12394 );             
     83                $this->knownWPBug( 12394 );
    8484                $content = <<<EOF
    8585<img src='foo' width='500' height='300'/>
     
    9292                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    9393                $post = get_post($id);
    94                
     94
    9595                $this->assertEquals( $expected, $post->post_content );
    9696        }
     
    9898        // make sure unbalanced tags are fixed when they span a --more-- tag
    9999        function test_post_content_unbalanced_more() {
    100                
     100
    101101                $content = <<<EOF
    102102<em>some text<!--more-->
     
    111111                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    112112                $post = get_post($id);
    113                
     113
    114114                $this->assertEquals( $expected, $post->post_content );
    115115        }
     
    117117        // make sure unbalanced tags are fixed when they span a --nextpage-- tag
    118118        function test_post_content_unbalanced_nextpage() {
    119                
     119
    120120                $content = <<<EOF
    121121<em>some text<!--nextpage-->
     
    130130                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    131131                $post = get_post($id);
    132                
     132
    133133                $this->assertEquals( $expected, $post->post_content );
    134134        }
     
    136136        // make sure unbalanced tags are fixed when they span both --more-- and --nextpage-- tags (in that order)
    137137        function test_post_content_unbalanced_more_nextpage() {
    138                
     138
    139139                $content = <<<EOF
    140140<em>some text<!--more-->
     
    157157                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    158158                $post = get_post($id);
    159                
    160                 $this->assertEquals( $expected, $post->post_content );
    161         }
    162        
     159
     160                $this->assertEquals( $expected, $post->post_content );
     161        }
     162
    163163        // make sure unbalanced tags are fixed when they span both --nextpage-- and --more-- tags (in that order)
    164164        function test_post_content_unbalanced_nextpage_more() {
    165                
     165
    166166                $content = <<<EOF
    167167<em>some text<!--nextpage-->
     
    184184                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    185185                $post = get_post($id);
    186                
    187                 $this->assertEquals( $expected, $post->post_content );
    188         }
    189        
     186
     187                $this->assertEquals( $expected, $post->post_content );
     188        }
     189
    190190        // make sure unbalanced tags are untouched when the balance option is off
    191191        function test_post_content_nobalance_nextpage_more() {
    192192
    193193                update_option('use_balanceTags', 0);
    194                
     194
    195195                $content = <<<EOF
    196196<em>some text<!--nextpage-->
     
    204204                $id = $this->_insert_quick_post(__FUNCTION__, $content);
    205205                $post = get_post($id);
    206                
     206
    207207                $this->assertEquals( $content, $post->post_content );
    208         }               
     208        }
    209209}
    210210
Note: See TracChangeset for help on using the changeset viewer.