- Timestamp:
- 08/28/2018 12:43:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r43584 r43585 410 410 411 411 $request = new WP_REST_Request( 'GET', $rest_route ); 412 $request->set_query_params( array( 413 'per_page' => $per_page, 414 'page' => $page, 415 )); 412 $request->set_query_params( 413 array( 414 'per_page' => $per_page, 415 'page' => $page, 416 ) 417 ); 416 418 $response = rest_get_server()->dispatch( $request ); 417 419 $headers = $response->get_headers(); … … 443 445 444 446 $request = new WP_REST_Request( 'GET', $rest_route ); 445 $request->set_query_params( array( 446 'per_page' => $per_page, 447 'page' => $page, 448 )); 447 $request->set_query_params( 448 array( 449 'per_page' => $per_page, 450 'page' => $page, 451 ) 452 ); 449 453 $response = rest_get_server()->dispatch( $request ); 450 454 $headers = $response->get_headers(); … … 455 459 'per_page' => $per_page, 456 460 'page' => $page - 1, 457 ), rest_url( $rest_route ) 461 ), 462 rest_url( $rest_route ) 458 463 ); 459 464 $this->assertContains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); … … 493 498 494 499 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 495 $request->set_query_params( array( 496 'per_page' => $per_page, 497 'page' => $page, 498 )); 500 $request->set_query_params( 501 array( 502 'per_page' => $per_page, 503 'page' => $page, 504 ) 505 ); 499 506 $response = rest_get_server()->dispatch( $request ); 500 507 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 515 522 516 523 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 517 $request->set_query_params( array( 518 'per_page' => $per_page, 519 'page' => $page, 520 )); 524 $request->set_query_params( 525 array( 526 'per_page' => $per_page, 527 'page' => $page, 528 ) 529 ); 521 530 $response = rest_get_server()->dispatch( $request ); 522 531 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 588 597 589 598 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 590 $request->set_query_params( array( 591 'offset' => $offset, 592 'per_page' => $per_page, 593 )); 599 $request->set_query_params( 600 array( 601 'offset' => $offset, 602 'per_page' => $per_page, 603 ) 604 ); 594 605 $response = rest_get_server()->dispatch( $request ); 595 606 $this->assertCount( $expected_count, $response->get_data() ); … … 610 621 611 622 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 612 $request->set_query_params( array( 613 'offset' => $offset, 614 'per_page' => $per_page, 615 'page' => $page, 616 )); 623 $request->set_query_params( 624 array( 625 'offset' => $offset, 626 'per_page' => $per_page, 627 'page' => $page, 628 ) 629 ); 617 630 $response = rest_get_server()->dispatch( $request ); 618 631 $this->assertCount( $expected_count, $response->get_data() ); … … 633 646 634 647 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 635 $request->set_query_params( array( 636 'offset' => $offset, 637 'per_page' => $per_page, 638 )); 648 $request->set_query_params( 649 array( 650 'offset' => $offset, 651 'per_page' => $per_page, 652 ) 653 ); 639 654 $response = rest_get_server()->dispatch( $request ); 640 655 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 655 670 656 671 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 657 $request->set_query_params( array( 658 'offset' => $offset, 659 'per_page' => $per_page, 660 )); 672 $request->set_query_params( 673 array( 674 'offset' => $offset, 675 'per_page' => $per_page, 676 ) 677 ); 661 678 $response = rest_get_server()->dispatch( $request ); 662 679 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 677 694 678 695 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 679 $request->set_query_params( array( 680 'offset' => $offset, 681 'per_page' => $per_page, 682 )); 696 $request->set_query_params( 697 array( 698 'offset' => $offset, 699 'per_page' => $per_page, 700 ) 701 ); 683 702 $response = rest_get_server()->dispatch( $request ); 684 703 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 699 718 700 719 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 701 $request->set_query_params( array( 702 'offset' => $offset, 703 'per_page' => $per_page, 704 )); 720 $request->set_query_params( 721 array( 722 'offset' => $offset, 723 'per_page' => $per_page, 724 ) 725 ); 705 726 $response = rest_get_server()->dispatch( $request ); 706 727 $this->assertErrorResponse( $expected_error, $response, $expected_status ); … … 722 743 723 744 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 724 $request->set_query_params( array( 725 'offset' => 1, 726 'per_page' => $per_page, 727 'page' => $page, 728 )); 745 $request->set_query_params( 746 array( 747 'offset' => 1, 748 'per_page' => $per_page, 749 'page' => $page, 750 ) 751 ); 729 752 $response = rest_get_server()->dispatch( $request ); 730 753 $this->assertCount( $expected_count, $response->get_data() );
Note: See TracChangeset
for help on using the changeset viewer.