Changeset 47381 for trunk/tests/phpunit/tests/post/types.php
- Timestamp:
- 02/26/2020 01:16:10 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/types.php
r47196 r47381 76 76 * 'exclude_from_search' Default is null (opposite 'public') 77 77 */ 78 $args = $this->register_post_type(array( 'public' => $public = false ) );78 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 79 79 80 80 $this->assertNotEquals( $public, $args->exclude_from_search ); … … 90 90 * 'publicly_queryable' Default is null ('public') 91 91 */ 92 $args = $this->register_post_type(array( 'public' => $public = false ) );92 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 93 93 94 94 $this->assertSame( $public, $args->publicly_queryable ); … … 104 104 * 'show_ui' Default is null ('public') 105 105 */ 106 $args = $this->register_post_type(array( 'public' => $public = false ) );106 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 107 107 108 108 $this->assertSame( $public, $args->show_ui ); … … 119 119 * 'show_in_menu Default is null ('show_ui' > 'public') 120 120 */ 121 $args = $this->register_post_type(array( 'public' => $public = false ) );121 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 122 122 123 123 // Should fall back to 'show_ui'. … … 137 137 * 'show_in_nav_menus' Default is null ('public') 138 138 */ 139 $args = $this->register_post_type(array( 'public' => $public = false ) );139 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 140 140 141 141 $this->assertSame( $public, $args->show_in_nav_menus ); … … 152 152 * 'show_in_admin_bar' Default is null ('show_in_menu' > 'show_ui' > 'public') 153 153 */ 154 $args = $this->register_post_type(array( 'public' => $public = false ) );154 $args = register_post_type( $this->post_type, array( 'public' => $public = false ) ); 155 155 156 156 // Should fall back to 'show_in_menu'. … … 573 573 $this->assertEqualSets( array(), get_post_types_by_support( 'somefeature' ) ); 574 574 } 575 576 /**577 * Serves as a helper to register a post type for tests.578 *579 * Uses `$this->post_type` initialized in setUp().580 *581 * @since 4.5.0582 *583 * @param array $args register_post_type() arguments.584 * @return WP_Post_Type Post type object for `$this->post_type`.585 */586 public function register_post_type( $args = array() ) {587 register_post_type( $this->post_type, $args );588 return get_post_type_object( $this->post_type );589 }590 575 }
Note: See TracChangeset
for help on using the changeset viewer.