Changeset 52010 for trunk/tests/phpunit/tests/post/types.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/types.php
r51568 r52010 19 19 * @since 4.5.0 20 20 */ 21 function set_up() {21 public function set_up() { 22 22 parent::set_up(); 23 23 … … 25 25 } 26 26 27 function test_register_post_type() {27 public function test_register_post_type() { 28 28 $this->assertNull( get_post_type_object( 'foo' ) ); 29 29 register_post_type( 'foo' ); … … 43 43 * @ticket 48558 44 44 */ 45 function test_register_post_type_return_value() {45 public function test_register_post_type_return_value() { 46 46 $this->assertInstanceOf( 'WP_Post_Type', register_post_type( 'foo' ) ); 47 47 } … … 52 52 * @expectedIncorrectUsage register_post_type 53 53 */ 54 function test_register_post_type_with_too_long_name() {54 public function test_register_post_type_with_too_long_name() { 55 55 // Post type too long. 56 56 $this->assertInstanceOf( 'WP_Error', register_post_type( 'abcdefghijklmnopqrstuvwxyz0123456789' ) ); … … 62 62 * @expectedIncorrectUsage register_post_type 63 63 */ 64 function test_register_post_type_with_empty_name() {64 public function test_register_post_type_with_empty_name() { 65 65 // Post type too short. 66 66 $this->assertInstanceOf( 'WP_Error', register_post_type( '' ) ); … … 71 71 * @covers ::register_post_type 72 72 */ 73 function test_register_post_type_exclude_from_search_should_default_to_opposite_value_of_public() {73 public function test_register_post_type_exclude_from_search_should_default_to_opposite_value_of_public() { 74 74 /* 75 75 * 'public' Default is false … … 85 85 * @covers ::register_post_type 86 86 */ 87 function test_register_post_type_publicly_queryable_should_default_to_value_of_public() {87 public function test_register_post_type_publicly_queryable_should_default_to_value_of_public() { 88 88 /* 89 89 * 'public' Default is false … … 99 99 * @covers ::register_post_type 100 100 */ 101 function test_register_post_type_show_ui_should_default_to_value_of_public() {101 public function test_register_post_type_show_ui_should_default_to_value_of_public() { 102 102 /* 103 103 * 'public' Default is false … … 113 113 * @covers ::register_post_type 114 114 */ 115 function test_register_post_type_show_in_menu_should_default_to_value_of_show_ui() {115 public function test_register_post_type_show_in_menu_should_default_to_value_of_show_ui() { 116 116 /* 117 117 * 'public' Default is false … … 132 132 * @covers ::register_post_type 133 133 */ 134 function test_register_post_type_show_in_nav_menus_should_default_to_value_of_public() {134 public function test_register_post_type_show_in_nav_menus_should_default_to_value_of_public() { 135 135 /* 136 136 * 'public' Default is false … … 146 146 * @covers ::register_post_type 147 147 */ 148 function test_register_post_type_show_in_admin_bar_should_default_to_value_of_show_in_menu() {148 public function test_register_post_type_show_in_admin_bar_should_default_to_value_of_show_in_menu() { 149 149 /* 150 150 * 'public' Default is false … … 164 164 } 165 165 166 function test_register_taxonomy_for_object_type() {166 public function test_register_taxonomy_for_object_type() { 167 167 global $wp_taxonomies; 168 168 … … 186 186 } 187 187 188 function test_post_type_exists() {188 public function test_post_type_exists() { 189 189 $this->assertFalse( post_type_exists( 'notaposttype' ) ); 190 190 $this->assertTrue( post_type_exists( 'post' ) ); 191 191 } 192 192 193 function test_post_type_supports() {193 public function test_post_type_supports() { 194 194 $this->assertTrue( post_type_supports( 'post', 'post-formats' ) ); 195 195 $this->assertFalse( post_type_supports( 'page', 'post-formats' ) ); … … 202 202 * @ticket 21586 203 203 */ 204 function test_post_type_with_no_support() {204 public function test_post_type_with_no_support() { 205 205 register_post_type( 'foo', array( 'supports' => array() ) ); 206 206 $this->assertTrue( post_type_supports( 'foo', 'editor' ) ); … … 217 217 * @ticket 23302 218 218 */ 219 function test_post_type_with_no_feed() {219 public function test_post_type_with_no_feed() { 220 220 global $wp_rewrite; 221 221 $old_permastruct = get_option( 'permalink_structure' );
Note: See TracChangeset
for help on using the changeset viewer.