Changeset 51962 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 10/31/2021 11:15:10 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/rest-api.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r51648 r51962 1831 1831 1832 1832 /** 1833 * @ticket 53656 1834 */ 1835 public function test_rest_get_route_for_post_custom_namespace() { 1836 register_post_type( 1837 'cpt', 1838 array( 1839 'show_in_rest' => true, 1840 'rest_base' => 'cpt', 1841 'rest_namespace' => 'wordpress/v1', 1842 ) 1843 ); 1844 $post = self::factory()->post->create_and_get( array( 'post_type' => 'cpt' ) ); 1845 1846 $this->assertSame( '/wordpress/v1/cpt/' . $post->ID, rest_get_route_for_post( $post ) ); 1847 unregister_post_type( 'cpt' ); 1848 } 1849 1850 /** 1851 * @ticket 53656 1852 */ 1853 public function test_rest_get_route_for_post_type_items() { 1854 $this->assertSame( '/wp/v2/posts', rest_get_route_for_post_type_items( 'post' ) ); 1855 } 1856 1857 /** 1858 * @ticket 53656 1859 */ 1860 public function test_rest_get_route_for_post_type_items_custom_namespace() { 1861 register_post_type( 1862 'cpt', 1863 array( 1864 'show_in_rest' => true, 1865 'rest_base' => 'cpt', 1866 'rest_namespace' => 'wordpress/v1', 1867 ) 1868 ); 1869 1870 $this->assertSame( '/wordpress/v1/cpt', rest_get_route_for_post_type_items( 'cpt' ) ); 1871 unregister_post_type( 'cpt' ); 1872 } 1873 1874 /** 1833 1875 * @ticket 49116 1834 1876 */ … … 1840 1882 /** 1841 1883 * @ticket 49116 1884 * @ticket 53656 1842 1885 */ 1843 1886 public function test_rest_get_route_for_post_custom_controller() { 1844 1887 $post = self::factory()->post->create_and_get( array( 'post_type' => 'wp_block' ) ); 1845 $this->assertSame( ' ', rest_get_route_for_post( $post ) );1888 $this->assertSame( '/wp/v2/blocks/' . $post->ID, rest_get_route_for_post( $post ) ); 1846 1889 } 1847 1890
Note: See TracChangeset
for help on using the changeset viewer.