Changeset 43833 for branches/5.0/tests/phpunit/tests/rest-api.php
- Timestamp:
- 10/29/2018 12:23:11 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/tests/phpunit/tests/rest-api.php
r43766 r43833 630 630 $this->assertTrue( is_array( rest_preload_api_request( 0, '/' ) ) ); 631 631 } 632 633 function test_rest_preload_api_request_with_method() { 634 $rest_server = $GLOBALS['wp_rest_server']; 635 $GLOBALS['wp_rest_server'] = null; 636 637 $preload_paths = array( 638 '/wp/v2/types', 639 array( '/wp/v2/media', 'OPTIONS' ), 640 ); 641 642 $preload_data = array_reduce( 643 $preload_paths, 644 'rest_preload_api_request', 645 array() 646 ); 647 648 $this->assertSame( array_keys( $preload_data ), array( '/wp/v2/types', 'OPTIONS' ) ); 649 $this->assertTrue( isset( $preload_data['OPTIONS']['/wp/v2/media'] ) ); 650 651 $GLOBALS['wp_rest_server'] = $rest_server; 652 } 632 653 }
Note: See TracChangeset
for help on using the changeset viewer.