- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php
r46586 r47122 6 6 $post_type_obj = get_post_type_object( $post->post_type ); 7 7 8 // Standard fields 8 // Standard fields. 9 9 $this->assertEquals( $post->ID, $data['id'] ); 10 10 $this->assertEquals( $post->post_name, $data['slug'] ); … … 26 26 $this->assertEquals( mysql_to_rfc3339( $post->post_modified ), $data['modified'] ); 27 27 28 // author28 // Author. 29 29 if ( post_type_supports( $post->post_type, 'author' ) ) { 30 30 $this->assertEquals( $post->post_author, $data['author'] ); … … 33 33 } 34 34 35 // post_parent35 // Post parent. 36 36 if ( $post_type_obj->hierarchical ) { 37 37 $this->assertArrayHasKey( 'parent', $data ); … … 50 50 } 51 51 52 // page attributes52 // Page attributes. 53 53 if ( $post_type_obj->hierarchical && post_type_supports( $post->post_type, 'page-attributes' ) ) { 54 54 $this->assertEquals( $post->menu_order, $data['menu_order'] ); … … 57 57 } 58 58 59 // Comments 59 // Comments. 60 60 if ( post_type_supports( $post->post_type, 'comments' ) ) { 61 61 $this->assertEquals( $post->comment_status, $data['comment_status'] ); … … 111 111 112 112 if ( post_type_supports( $post->post_type, 'editor' ) ) { 113 // TODO: apply content filter for more accurate testing.113 // TODO: Apply content filter for more accurate testing. 114 114 if ( ! $post->post_password ) { 115 115 $this->assertEquals( wpautop( $post->post_content ), $data['content']['rendered'] ); … … 127 127 if ( post_type_supports( $post->post_type, 'excerpt' ) ) { 128 128 if ( empty( $post->post_password ) ) { 129 // TODO: apply excerpt filter for more accurate testing.129 // TODO: Apply excerpt filter for more accurate testing. 130 130 $this->assertEquals( wpautop( $post->post_excerpt ), $data['excerpt']['rendered'] ); 131 131 } else { 132 // TODO: better testing for excerpts for password protected posts.132 // TODO: Better testing for excerpts for password protected posts. 133 133 } 134 134 if ( 'edit' === $context ) { … … 157 157 } 158 158 159 // test links159 // Test links. 160 160 if ( $links ) { 161 161 … … 212 212 foreach ( $all_data as $data ) { 213 213 $post = get_post( $data['id'] ); 214 // as the links for the post are "response_links" format in the data array we have to pull them215 // out and parse them.214 // As the links for the post are "response_links" format in the data array, 215 // we have to pull them out and parse them. 216 216 $links = $data['_links']; 217 217 foreach ( $links as &$links_array ) {
Note: See TracChangeset
for help on using the changeset viewer.