Changeset 47122 for trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
- Timestamp:
- 01/29/2020 12:43:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
r46586 r47122 151 151 $this->make_user_by_role( 'author' ); 152 152 153 // create attachment153 // Create attachment. 154 154 $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' ); 155 155 $attachment_id = self::factory()->attachment->create_upload_object( $filename ); … … 313 313 $cat2_name = 'cat2'; 314 314 315 // first a post with valid categories; one that already exists and one to be created315 // First a post with valid categories; one that already exists and one to be created. 316 316 $post = array( 317 317 'post_title' => 'Test', … … 322 322 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 323 323 $this->assertNotIXRError( $result ); 324 // verify that cat2 was created324 // Verify that cat2 was created. 325 325 $cat2 = get_term_by( 'name', $cat2_name, 'category' ); 326 326 $this->assertNotEmpty( $cat2 ); 327 // check that both categories were set on the post327 // Check that both categories were set on the post. 328 328 $post_cats = wp_get_object_terms( $result, 'category', array( 'fields' => 'ids' ) ); 329 329 $this->assertContains( $cat1, $post_cats ); 330 330 $this->assertContains( $cat2->term_id, $post_cats ); 331 331 332 // create a second post attempting to use the ambiguous name332 // Create a second post attempting to use the ambiguous name. 333 333 $post2 = array( 334 334 'post_title' => 'Test',
Note: See TracChangeset
for help on using the changeset viewer.