Changeset 57623 for trunk/tests/phpunit/tests/rest-api/rest-server.php
- Timestamp:
- 02/13/2024 01:46:45 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-server.php
r57147 r57623 930 930 $this->assertArrayNotHasKey( '_embedded', $result ); 931 931 $this->assertSame( 'data', $result['untouched'] ); 932 } 933 934 /** 935 * Ensure embedding is with links in the data. 936 * 937 * @ticket 43439 938 */ 939 public function test_link_embedding_with_links() { 940 $data = array( 941 '_links' => array( 942 'wp:term' => array( 943 array( 944 'taxonomy' => 'category', 945 'embeddable' => true, 946 'href' => get_rest_url( 0, '/wp/v2/categories' ), 947 ), 948 array( 949 'taxonomy' => 'post_tag', 950 'embeddable' => true, 951 'href' => get_rest_url( 0, '/wp/v2/tags' ), 952 ), 953 ), 954 ), 955 ); 956 957 $mock = new MockAction(); 958 add_filter( 'rest_post_dispatch', array( $mock, 'filter' ), 10, 3 ); 959 960 rest_get_server()->embed_links( $data, true ); 961 $args = $mock->get_args(); 962 foreach ( $args as $arg ) { 963 $this->assertSame( 100, $arg[2]['per_page'], 'Posts per page should be 100' ); 964 } 932 965 } 933 966
Note: See TracChangeset
for help on using the changeset viewer.