Changeset 39137 for trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
- Timestamp:
- 11/04/2016 06:03:51 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
r39038 r39137 175 175 array( 176 176 array( 177 'type' => 'post_type', 178 'object' => '', 179 ), 180 array( 181 'success' => false, 182 'data' => 'nav_menus_missing_type_or_object_parameter', 183 ), 184 ), 185 // Testing empty type. 186 array( 187 array( 177 188 'type' => '', 178 189 'object' => 'post', … … 183 194 ), 184 195 ), 185 // Testing empty type. 186 array( 187 array( 188 'type' => '', 189 'object' => 'post', 196 // Testing empty type of a bulk request. 197 array( 198 array( 199 'item_types' => array( 200 array( 201 'type' => 'post_type', 202 'object' => 'post', 203 ), 204 array( 205 'type' => 'post_type', 206 'object' => '', 207 ), 208 ), 190 209 ), 191 210 array( … … 274 293 'type' => 'taxonomy', 275 294 'object' => 'post_tag', 295 ), 296 true, 297 ), 298 // Testing a bulk request. 299 array( 300 array( 301 'item_types' => array( 302 array( 303 'type' => 'post_type', 304 'object' => 'post', 305 ), 306 array( 307 'type' => 'post_type', 308 'object' => 'page', 309 ), 310 ), 276 311 ), 277 312 true, … … 314 349 $response = json_decode( $this->_last_response, true ); 315 350 316 $this->assertNotEmpty( $response['data']['items']);351 $this->assertNotEmpty( current( $response['data']['items'] ) ); 317 352 318 353 // Get the second index to avoid the home page edge case. 319 $test_item = $response['data']['items'][1]; 354 $first_prop = current( $response['data']['items'] ); 355 $test_item = $first_prop[1]; 320 356 321 357 foreach ( $expected_keys as $key ) { … … 326 362 // Special test for the home page. 327 363 if ( 'page' === $test_item['object'] ) { 328 $home = $response['data']['items'][0]; 364 $first_prop = current( $response['data']['items'] ); 365 $home = $first_prop[0]; 329 366 foreach ( $expected_keys as $key ) { 330 367 if ( 'object_id' !== $key ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)