Changeset 51882
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php
r51786 r51882 238 238 } 239 239 240 ksort( $widgets ); 241 240 242 return $widgets; 241 243 } -
trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php
r51657 r51882 127 127 128 128 /** 129 * @ticket 53303 130 */ 131 public function test_get_items_ordering() { 132 wp_set_current_user( self::$admin_id ); 133 $request = new WP_REST_Request( 'GET', '/wp/v2/widget-types' ); 134 $response = rest_get_server()->dispatch( $request ); 135 $data = $response->get_data(); 136 $this->assertGreaterThan( 1, count( $data ) ); 137 $ids = wp_list_pluck( $data, 'id' ); 138 $sorted = $ids; 139 sort( $sorted ); 140 141 $this->assertSame( $sorted, $ids ); 142 } 143 144 /** 129 145 * @ticket 53305 130 146 */
Note: See TracChangeset
for help on using the changeset viewer.