Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php
r40417 r42343 13 13 parent::setUp(); 14 14 15 $this->post_date_ts = strtotime( '+1 day' );16 $this->post_data = array(17 'post_title' => rand_str(),15 $this->post_date_ts = strtotime( '+1 day' ); 16 $this->post_data = array( 17 'post_title' => rand_str(), 18 18 'post_content' => rand_str( 2000 ), 19 19 'post_excerpt' => rand_str( 100 ), 20 'post_author' => $this->make_user_by_role( 'author' ),21 'post_date' => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),20 'post_author' => $this->make_user_by_role( 'author' ), 21 'post_date' => strftime( '%Y-%m-%d %H:%M:%S', $this->post_date_ts ), 22 22 ); 23 $this->post_id = wp_insert_post( $this->post_data ); 24 $this->post_custom_field = array( 'key' => 'test_custom_field', 'value' => 12345678); 23 $this->post_id = wp_insert_post( $this->post_data ); 24 $this->post_custom_field = array( 25 'key' => 'test_custom_field', 26 'value' => 12345678, 27 ); 25 28 $this->post_custom_field['id'] = add_post_meta( $this->post_id, $this->post_custom_field['key'], $this->post_custom_field['value'] ); 26 29 } … … 110 113 $this->assertEquals( $this->post_date_ts, $result['post_modified']->getTimestamp() ); 111 114 112 $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );115 $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) ); 113 116 $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) ); 114 117 … … 124 127 125 128 $parent_page_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); 126 $child_page_id = self::factory()->post->create( array( 127 'post_type' => 'page', 128 'post_parent' => $parent_page_id, 129 'menu_order' => 2 130 ) ); 129 $child_page_id = self::factory()->post->create( 130 array( 131 'post_type' => 'page', 132 'post_parent' => $parent_page_id, 133 'menu_order' => 2, 134 ) 135 ); 131 136 132 137 $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) );
Note: See TracChangeset
for help on using the changeset viewer.