Changeset 51964 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 11/01/2021 03:26:06 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r51962 r51964 1964 1964 1965 1965 /** 1966 * @ticket 54267 1967 */ 1968 public function test_rest_get_route_for_taxonomy_custom_namespace() { 1969 register_taxonomy( 1970 'ct', 1971 'post', 1972 array( 1973 'show_in_rest' => true, 1974 'rest_base' => 'ct', 1975 'rest_namespace' => 'wordpress/v1', 1976 ) 1977 ); 1978 $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'ct' ) ); 1979 1980 $this->assertSame( '/wordpress/v1/ct/' . $term->term_id, rest_get_route_for_term( $term ) ); 1981 unregister_taxonomy( 'ct' ); 1982 } 1983 1984 /** 1985 * @ticket 54267 1986 */ 1987 public function test_rest_get_route_for_taxonomy_items() { 1988 $this->assertSame( '/wp/v2/categories', rest_get_route_for_taxonomy_items( 'category' ) ); 1989 } 1990 1991 /** 1992 * @ticket 54267 1993 */ 1994 public function test_rest_get_route_for_taxonomy_items_custom_namespace() { 1995 register_taxonomy( 1996 'ct', 1997 'post', 1998 array( 1999 'show_in_rest' => true, 2000 'rest_base' => 'ct', 2001 'rest_namespace' => 'wordpress/v1', 2002 ) 2003 ); 2004 2005 $this->assertSame( '/wordpress/v1/ct', rest_get_route_for_taxonomy_items( 'ct' ) ); 2006 unregister_post_type( 'ct' ); 2007 } 2008 2009 /** 1966 2010 * @ticket 50300 1967 2011 *
Note: See TracChangeset
for help on using the changeset viewer.