WordPress.org

Make WordPress Core

Changeset 1040 in tests


Ignore:
Timestamp:
09/22/12 16:33:44 (19 months ago)
Author:
scribu
Message:

replace calls to deprecated wp_get_single_post() with get_post()

Location:
trunk/tests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post.php

    r1039 r1040  
    4848 
    4949            // fetch the post and make sure it matches 
    50             $out = wp_get_single_post($id); 
     50            $out = get_post($id); 
    5151 
    5252            $this->assertEquals($post['post_content'], $out->post_content); 
     
    102102 
    103103        // fetch the post and make sure it matches 
    104         $out = wp_get_single_post($id); 
     104        $out = get_post($id); 
    105105 
    106106        $this->assertEquals($post['post_content'], $out->post_content); 
     
    134134 
    135135        // fetch the post and make sure has the correct date and status 
    136         $out = wp_get_single_post($id); 
     136        $out = get_post($id); 
    137137        $this->assertEquals('future', $out->post_status); 
    138138        $this->assertEquals($post['post_date'], $out->post_date); 
     
    149149 
    150150        // fetch the post again and make sure it has the new post_date 
    151         $out = wp_get_single_post($id); 
     151        $out = get_post($id); 
    152152        $this->assertEquals('future', $out->post_status); 
    153153        $this->assertEquals($post['post_date'], $out->post_date); 
     
    176176 
    177177        // fetch the post and make sure has the correct date and status 
    178         $out = wp_get_single_post($id); 
     178        $out = get_post($id); 
    179179        $this->assertEquals('future', $out->post_status); 
    180180        $this->assertEquals($post['post_date'], $out->post_date); 
     
    191191 
    192192        // fetch the post again and make sure it has the new post_date 
    193         $out = wp_get_single_post($id); 
     193        $out = get_post($id); 
    194194        $this->assertEquals('future', $out->post_status); 
    195195        $this->assertEquals($post['post_date'], $out->post_date); 
     
    219219 
    220220        // fetch the post and make sure it matches 
    221         $out = wp_get_single_post($id); 
     221        $out = get_post($id); 
    222222 
    223223        $this->assertEquals($post['post_content'], $out->post_content); 
     
    248248 
    249249        // fetch the post and make sure has the correct date and status 
    250         $out = wp_get_single_post($id); 
     250        $out = get_post($id); 
    251251        $this->assertEquals('future', $out->post_status); 
    252252        $this->assertEquals($post['post_date'], $out->post_date); 
     
    262262 
    263263        // fetch the post again and make sure it has the new post_date 
    264         $out = wp_get_single_post($id); 
     264        $out = get_post($id); 
    265265        $this->assertEquals('draft', $out->post_status); 
    266266        $this->assertEquals($post['post_date'], $out->post_date); 
     
    289289 
    290290            // fetch the post and make sure has the correct date and status 
    291             $out = wp_get_single_post($id); 
     291            $out = get_post($id); 
    292292            $this->assertEquals('future', $out->post_status); 
    293293            $this->assertEquals($post['post_date'], $out->post_date); 
     
    303303 
    304304            // fetch the post again and make sure it has the new post_date 
    305             $out = wp_get_single_post($id); 
     305            $out = get_post($id); 
    306306            $this->assertEquals($status, $out->post_status); 
    307307            $this->assertEquals($post['post_date'], $out->post_date); 
     
    332332 
    333333        // fetch the post and make sure it matches 
    334         $out = wp_get_single_post($id); 
     334        $out = get_post($id); 
    335335 
    336336        $this->assertEquals($post['post_content'], $out->post_content); 
     
    383383 
    384384        // fetch the post and make sure has the correct date and status 
    385         $out = wp_get_single_post($id); 
     385        $out = get_post($id); 
    386386        $this->assertEquals('future', $out->post_status); 
    387387        $this->assertEquals($post['post_date'], $out->post_date); 
     
    397397 
    398398        // fetch the post again and make sure it has the new post_date 
    399         $out = wp_get_single_post($id); 
     399        $out = get_post($id); 
    400400        $this->assertEquals('private', $out->post_status); 
    401401        $this->assertEquals($post['post_date'], $out->post_date); 
  • trunk/tests/xmlrpc/mw/editPost.php

    r904 r1040  
    2424        $this->assertTrue($result); 
    2525 
    26         $out = wp_get_single_post( $post_id ); 
     26        $out = get_post( $post_id ); 
    2727        $this->assertEquals( $new_title, $out->post_title ); 
    2828    } 
     
    4141        $this->assertTrue($result); 
    4242 
    43         $out = wp_get_single_post( $post_id ); 
     43        $out = get_post( $post_id ); 
    4444        $this->assertEquals( $new_title, $out->post_title ); 
    4545    } 
     
    5959        $this->assertEquals( 401, $result->code ); 
    6060 
    61         $out = wp_get_single_post( $post_id ); 
     61        $out = get_post( $post_id ); 
    6262        $this->assertEquals( $original_title, $out->post_title ); 
    6363    } 
     
    7676        $this->assertTrue($result); 
    7777 
    78         $out = wp_get_single_post( $post_id ); 
     78        $out = get_post( $post_id ); 
    7979        $this->assertEquals( $author_id, $out->post_author ); 
    8080    } 
     
    9292        $this->assertEquals( 401, $result->code ); 
    9393 
    94         $out = wp_get_single_post( $post_id ); 
     94        $out = get_post( $post_id ); 
    9595        $this->assertEquals( $contributor_id, $out->post_author ); 
    9696    } 
     
    162162        $this->assertTrue($result); 
    163163 
    164         $out = wp_get_single_post( $post_id ); 
     164        $out = get_post( $post_id ); 
    165165        $this->assertEquals( $post2['title'], $out->post_title ); 
    166166 
     
    170170        $this->assertTrue($result); 
    171171 
    172         $out = wp_get_single_post( $post_id ); 
     172        $out = get_post( $post_id ); 
    173173        $this->assertEquals( $post2['title'], $out->post_title ); 
    174174        $this->assertEquals( $post3['description'], $out->post_content ); 
     
    179179        $this->assertTrue($result); 
    180180 
    181         $out = wp_get_single_post( $post_id ); 
     181        $out = get_post( $post_id ); 
    182182        $this->assertEquals( $post2['title'], $out->post_title ); 
    183183        $this->assertEquals( $post3['description'], $out->post_content ); 
  • trunk/tests/xmlrpc/mw/newPost.php

    r904 r1040  
    106106        $this->assertStringMatchesFormat( '%d', $result ); 
    107107 
    108         $out = wp_get_single_post( $result ); 
     108        $out = get_post( $result ); 
    109109        $this->assertEquals( $my_author_id, $out->post_author ); 
    110110        $this->assertEquals( 'Test', $out->post_title ); 
     
    155155        $this->assertStringMatchesFormat( '%d', $result ); 
    156156 
    157         $out = wp_get_single_post( $result ); 
     157        $out = get_post( $result ); 
    158158        $this->assertEquals( 'Test', $out->post_title ); 
    159159        $this->assertEquals( 'page', $out->post_type ); 
  • trunk/tests/xmlrpc/wp/editPost.php

    r904 r1040  
    2424        $this->assertTrue($result); 
    2525 
    26         $out = wp_get_single_post( $post_id ); 
     26        $out = get_post( $post_id ); 
    2727        $this->assertEquals( $new_title, $out->post_title ); 
    2828    } 
     
    4141        $this->assertTrue($result); 
    4242 
    43         $out = wp_get_single_post( $post_id ); 
     43        $out = get_post( $post_id ); 
    4444        $this->assertEquals( $new_title, $out->post_title ); 
    4545    } 
     
    5959        $this->assertEquals( 401, $result->code ); 
    6060 
    61         $out = wp_get_single_post( $post_id ); 
     61        $out = get_post( $post_id ); 
    6262        $this->assertEquals( $original_title, $out->post_title ); 
    6363    } 
     
    7676        $this->assertTrue($result); 
    7777 
    78         $out = wp_get_single_post( $post_id ); 
     78        $out = get_post( $post_id ); 
    7979        $this->assertEquals( $author_id, $out->post_author ); 
    8080    } 
     
    9292        $this->assertEquals( 401, $result->code ); 
    9393 
    94         $out = wp_get_single_post( $post_id ); 
     94        $out = get_post( $post_id ); 
    9595        $this->assertEquals( $contributor_id, $out->post_author ); 
    9696    } 
     
    187187        $this->assertTrue($result); 
    188188 
    189         $out = wp_get_single_post( $post_id ); 
     189        $out = get_post( $post_id ); 
    190190        $this->assertEquals( $new_title, $out->post_title ); 
    191191 
  • trunk/tests/xmlrpc/wp/newPost.php

    r922 r1040  
    117117        $this->assertStringMatchesFormat( '%d', $result ); 
    118118 
    119         $out = wp_get_single_post( $result ); 
     119        $out = get_post( $result ); 
    120120        $this->assertEquals( $my_author_id, $out->post_author ); 
    121121        $this->assertEquals( 'Test', $out->post_title ); 
Note: See TracChangeset for help on using the changeset viewer.