WordPress.org

Make WordPress Core

Changeset 1039 in tests


Ignore:
Timestamp:
09/21/2012 06:47:04 PM (6 years ago)
Author:
nacin
Message:

Basic test for wp_publish_post(). see #WP11399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post.php

    r1027 r1039  
    509509        $this->assertEquals( $other_att, get_page_by_path( 'some-other-page' ) );
    510510    }
     511
     512    function test_wp_publish_post() {
     513        $draft_id = $this->factory->post->create( array( 'post_status' => 'draft' ) );
     514
     515        $post = get_post( $draft_id );
     516        $this->assertEquals( 'draft', $post->post_status );
     517
     518        wp_publish_post( $draft_id );
     519        $post = get_post( $draft_id );
     520
     521        $this->assertEquals( 'publish', $post->post_status );
     522    }
    511523}
Note: See TracChangeset for help on using the changeset viewer.