WordPress.org

Make WordPress Core

Changeset 813 in tests


Ignore:
Timestamp:
06/30/12 21:01:24 (3 years ago)
Author:
maxcutler
Message:

Port test_post_filtering.php. Fixes #94.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test_post_filtering.php

    r658 r813  
    44// these tests don't care what code is responsible for filtering or how it is called, just that it happens when a post is saved. 
    55 
    6  
    7 class TestPostFiltering extends WPTestCase { 
     6/** 
     7 * @group posts 
     8 */ 
     9class TestPostFiltering extends WP_UnitTestCase { 
    810    function setUp() { 
    911        parent::setUp(); 
     
    1416 
    1517    function tearDown() { 
     18        kses_remove_filters(); 
    1619        parent::tearDown(); 
    17         kses_remove_filters(); 
    18     } 
    19  
    20     function _insert_quick_post($title, $content, $more=array()) { 
    21         return $this->post_ids[] = wp_insert_post(array_merge(array( 
    22             'post_author' => $this->author->ID, 
    23             'post_status' => 'publish', 
    24             'post_title' => $title, 
    25             'post_content' => $content, 
    26             ), $more)); 
    2720    } 
    2821 
     
    3831EOF; 
    3932 
    40         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     33        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    4134        $post = get_post($id); 
    4235 
     
    5548EOF; 
    5649 
    57         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     50        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    5851        $post = get_post($id); 
    5952 
     
    7265EOF; 
    7366 
    74         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     67        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    7568        $post = get_post($id); 
    7669 
     
    9083EOF; 
    9184 
    92         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     85        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    9386        $post = get_post($id); 
    9487 
     
    110103EOF; 
    111104 
    112         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     105        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    113106        $post = get_post($id); 
    114107 
     
    130123EOF; 
    131124 
    132         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     125        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    133126        $post = get_post($id); 
    134127 
     
    158151EOF; 
    159152 
    160         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     153        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    161154        $post = get_post($id); 
    162155 
     
    186179EOF; 
    187180 
    188         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     181        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    189182        $post = get_post($id); 
    190183 
     
    206199EOF; 
    207200 
    208         $id = $this->_insert_quick_post(__FUNCTION__, $content); 
     201        $id = $this->factory->post->create( array( 'post_content' => $content ) ); 
    209202        $post = get_post($id); 
    210203 
Note: See TracChangeset for help on using the changeset viewer.