- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r43087 r43571 174 174 'status', 175 175 'type', 176 ), $keys 176 ), 177 $keys 177 178 ); 178 179 } … … 726 727 array( 727 728 'page' => 2, 728 ), rest_url( '/wp/v2/comments' ) 729 ), 730 rest_url( '/wp/v2/comments' ) 729 731 ); 730 732 $this->assertFalse( stripos( $headers['Link'], 'rel="prev"' ) ); … … 746 748 array( 747 749 'page' => 2, 748 ), rest_url( '/wp/v2/comments' ) 750 ), 751 rest_url( '/wp/v2/comments' ) 749 752 ); 750 753 $this->assertContains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); … … 752 755 array( 753 756 'page' => 4, 754 ), rest_url( '/wp/v2/comments' ) 757 ), 758 rest_url( '/wp/v2/comments' ) 755 759 ); 756 760 $this->assertContains( '<' . $next_link . '>; rel="next"', $headers['Link'] ); … … 765 769 array( 766 770 'page' => 5, 767 ), rest_url( '/wp/v2/comments' ) 771 ), 772 rest_url( '/wp/v2/comments' ) 768 773 ); 769 774 $this->assertContains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); … … 779 784 array( 780 785 'page' => 6, 781 ), rest_url( '/wp/v2/comments' ) 786 ), 787 rest_url( '/wp/v2/comments' ) 782 788 ); 783 789 $this->assertContains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); … … 856 862 $obj = get_comment( self::$approved_id ); 857 863 $response = $endpoint->prepare_item_for_response( $obj, $request ); 858 $this->assertEquals( array( 859 'id', 860 'status', 861 ), array_keys( $response->get_data() ) ); 864 $this->assertEquals( 865 array( 866 'id', 867 'status', 868 ), 869 array_keys( $response->get_data() ) 870 ); 862 871 } 863 872 … … 2666 2675 'author_name' => '\o/ ¯\_(ツ)_/¯', 2667 2676 'author_user_agent' => '\o/ ¯\_(ツ)_/¯', 2668 ), array( 2677 ), 2678 array( 2669 2679 'content' => array( 2670 2680 'raw' => '\o/ ¯\_(ツ)_/¯', … … 2686 2696 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2687 2697 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2688 ), array( 2698 ), 2699 array( 2689 2700 'content' => array( 2690 2701 'raw' => 'div <strong>strong</strong> oh noes', … … 2702 2713 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2703 2714 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2704 ), array( 2715 ), 2716 array( 2705 2717 'content' => array( 2706 2718 'raw' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', … … 2722 2734 'author_name' => '\\\&\\\ & &invalid; < < &lt;', 2723 2735 'author_user_agent' => '\\\&\\\ & &invalid; < < &lt;', 2724 ), array( 2736 ), 2737 array( 2725 2738 'content' => array( 2726 2739 'raw' => '\\\&\\\ & &invalid; < < &lt;', … … 2741 2754 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2742 2755 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2743 ), array( 2756 ), 2757 array( 2744 2758 'content' => array( 2745 2759 'raw' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', … … 2909 2923 2910 2924 register_rest_field( 2911 'comment', 'my_custom_int', array( 2925 'comment', 2926 'my_custom_int', 2927 array( 2912 2928 'schema' => $schema, 2913 2929 'get_callback' => array( $this, 'additional_field_get_callback' ), … … 2968 2984 2969 2985 register_rest_field( 2970 'comment', 'my_custom_int', array( 2986 'comment', 2987 'my_custom_int', 2988 array( 2971 2989 'schema' => $schema, 2972 2990 'get_callback' => array( $this, 'additional_field_get_callback' ), … … 3024 3042 'collection', 3025 3043 'up', 3026 ), array_keys( $links ) 3044 ), 3045 array_keys( $links ) 3027 3046 ); 3028 3047
Note: See TracChangeset
for help on using the changeset viewer.