Changeset 39372
- Timestamp:
- 11/30/2016 03:27:22 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/tests/phpunit/tests/rest-api/rest-posts-controller.php
r39353 r39372 1647 1647 $this->assertEquals( $params['content'], $post->post_content ); 1648 1648 $this->assertEquals( $params['excerpt'], $post->post_excerpt ); 1649 } 1650 1651 public function test_update_item_no_change() { 1652 wp_set_current_user( self::$editor_id ); 1653 $post = get_post( self::$post_id ); 1654 1655 $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', self::$post_id ) ); 1656 $request->set_param( 'author', $post->post_author ); 1657 1658 // Run twice to make sure that the update still succeeds even if no DB 1659 // rows are updated. 1660 $response = $this->server->dispatch( $request ); 1661 $this->check_update_post_response( $response ); 1662 1663 $response = $this->server->dispatch( $request ); 1664 $this->check_update_post_response( $response ); 1649 1665 } 1650 1666 -
branches/4.7/tests/phpunit/tests/rest-api/rest-tags-controller.php
r39193 r39372 553 553 $this->assertEquals( 'New Description', $data['description'] ); 554 554 $this->assertEquals( 'new-slug', $data['slug'] ); 555 } 556 557 public function test_update_item_no_change() { 558 wp_set_current_user( self::$administrator ); 559 $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' ); 560 561 $request = new WP_REST_Request( 'PUT', '/wp/v2/tags/' . $term->term_id ); 562 563 $response = $this->server->dispatch( $request ); 564 $this->assertEquals( 200, $response->get_status() ); 565 $request->set_param( 'slug', $term->slug ); 566 567 // Run twice to make sure that the update still succeeds even if no DB 568 // rows are updated. 569 $response = $this->server->dispatch( $request ); 570 $this->assertEquals( 200, $response->get_status() ); 571 572 $response = $this->server->dispatch( $request ); 573 $this->assertEquals( 200, $response->get_status() ); 555 574 } 556 575 -
branches/4.7/tests/phpunit/tests/rest-api/rest-users-controller.php
r39293 r39372 1086 1086 // as per https://core.trac.wordpress.org/ticket/21429 1087 1087 $this->assertEquals( $pw_before, $user->user_pass ); 1088 } 1089 1090 public function test_update_item_no_change() { 1091 $this->allow_user_to_manage_multisite(); 1092 wp_set_current_user( self::$user ); 1093 $user = get_userdata( self::$editor ); 1094 1095 $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', self::$editor ) ); 1096 $request->set_param( 'slug', $user->user_nicename ); 1097 1098 // Run twice to make sure that the update still succeeds even if no DB 1099 // rows are updated. 1100 $response = $this->server->dispatch( $request ); 1101 $this->assertEquals( 200, $response->get_status() ); 1102 1103 $response = $this->server->dispatch( $request ); 1104 $this->assertEquals( 200, $response->get_status() ); 1088 1105 } 1089 1106
Note: See TracChangeset
for help on using the changeset viewer.