@@ 46-73 (lines=28) @@ | ||
43 | $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); |
|
44 | } |
|
45 | ||
46 | public function test_registered_query_params() { |
|
47 | $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/pages' ); |
|
48 | $response = $this->server->dispatch( $request ); |
|
49 | $data = $response->get_data(); |
|
50 | $keys = array_keys( $data['endpoints'][0]['args'] ); |
|
51 | sort( $keys ); |
|
52 | $this->assertEquals( array( |
|
53 | 'after', |
|
54 | 'author', |
|
55 | 'author_exclude', |
|
56 | 'before', |
|
57 | 'context', |
|
58 | 'exclude', |
|
59 | 'filter', |
|
60 | 'include', |
|
61 | 'menu_order', |
|
62 | 'offset', |
|
63 | 'order', |
|
64 | 'orderby', |
|
65 | 'page', |
|
66 | 'parent', |
|
67 | 'parent_exclude', |
|
68 | 'per_page', |
|
69 | 'search', |
|
70 | 'slug', |
|
71 | 'status', |
|
72 | ), $keys ); |
|
73 | } |
|
74 | ||
75 | public function test_get_items() { |
|
76 |
@@ 82-110 (lines=29) @@ | ||
79 | $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); |
|
80 | } |
|
81 | ||
82 | public function test_registered_query_params() { |
|
83 | $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/comments' ); |
|
84 | $response = $this->server->dispatch( $request ); |
|
85 | $data = $response->get_data(); |
|
86 | $keys = array_keys( $data['endpoints'][0]['args'] ); |
|
87 | sort( $keys ); |
|
88 | $this->assertEquals( array( |
|
89 | 'after', |
|
90 | 'author', |
|
91 | 'author_email', |
|
92 | 'author_exclude', |
|
93 | 'before', |
|
94 | 'context', |
|
95 | 'exclude', |
|
96 | 'include', |
|
97 | 'karma', |
|
98 | 'offset', |
|
99 | 'order', |
|
100 | 'orderby', |
|
101 | 'page', |
|
102 | 'parent', |
|
103 | 'parent_exclude', |
|
104 | 'per_page', |
|
105 | 'post', |
|
106 | 'search', |
|
107 | 'status', |
|
108 | 'type', |
|
109 | ), $keys ); |
|
110 | } |
|
111 | ||
112 | public function test_get_items() { |
|
113 | $this->factory->comment->create_post_comments( $this->post_id, 6 ); |