- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/nav-menu-item-setting.php
r51568 r52010 19 19 * @see WP_UnitTestCase::setup() 20 20 */ 21 function set_up() {21 public function set_up() { 22 22 parent::set_up(); 23 23 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 32 32 * Delete the $wp_customize global when cleaning up scope. 33 33 */ 34 function clean_up_global_scope() {34 public function clean_up_global_scope() { 35 35 global $wp_customize; 36 36 $wp_customize = null; … … 44 44 * @return object 45 45 */ 46 function filter_type_label( $menu_item ) {46 public function filter_type_label( $menu_item ) { 47 47 if ( 'custom_type' === $menu_item->type ) { 48 48 $menu_item->type_label = 'Custom Label'; … … 55 55 * Test constants and statics. 56 56 */ 57 function test_constants() {57 public function test_constants() { 58 58 do_action( 'customize_register', $this->wp_customize ); 59 59 $this->assertTrue( post_type_exists( WP_Customize_Nav_Menu_Item_Setting::POST_TYPE ) ); … … 65 65 * @see WP_Customize_Nav_Menu_Item_Setting::__construct() 66 66 */ 67 function test_construct() {67 public function test_construct() { 68 68 do_action( 'customize_register', $this->wp_customize ); 69 69 … … 109 109 * Test empty constructor. 110 110 */ 111 function test_construct_empty_menus() {111 public function test_construct_empty_menus() { 112 112 do_action( 'customize_register', $this->wp_customize ); 113 113 $_wp_customize = $this->wp_customize; … … 129 129 * @see WP_Customize_Nav_Menu_Item_Setting::__construct() 130 130 */ 131 function test_construct_placeholder() {131 public function test_construct_placeholder() { 132 132 do_action( 'customize_register', $this->wp_customize ); 133 133 $default = array( … … 147 147 * @see WP_Customize_Nav_Menu_Item_Setting::value() 148 148 */ 149 function test_value_type_post_type() {149 public function test_value_type_post_type() { 150 150 do_action( 'customize_register', $this->wp_customize ); 151 151 … … 198 198 * @see WP_Customize_Nav_Menu_Item_Setting::value() 199 199 */ 200 function test_value_type_post_type_without_label() {200 public function test_value_type_post_type_without_label() { 201 201 do_action( 'customize_register', $this->wp_customize ); 202 202 … … 230 230 * @see WP_Customize_Nav_Menu_Item_Setting::value() 231 231 */ 232 function test_value_type_taxonomy() {232 public function test_value_type_taxonomy() { 233 233 do_action( 'customize_register', $this->wp_customize ); 234 234 … … 269 269 * @see WP_Customize_Nav_Menu_Item_Setting::value() 270 270 */ 271 function test_custom_type_label() {271 public function test_custom_type_label() { 272 272 do_action( 'customize_register', $this->wp_customize ); 273 273 add_filter( 'wp_setup_nav_menu_item', array( $this, 'filter_type_label' ) ); … … 301 301 * @see WP_Customize_Nav_Menu_Item_Setting::value() 302 302 */ 303 function test_value_nav_menu_term_id_returns_zero() {303 public function test_value_nav_menu_term_id_returns_zero() { 304 304 do_action( 'customize_register', $this->wp_customize ); 305 305 … … 346 346 * @see WP_Customize_Nav_Menu_Item_Setting::preview() 347 347 */ 348 function test_preview_updated() {348 public function test_preview_updated() { 349 349 do_action( 'customize_register', $this->wp_customize ); 350 350 … … 401 401 * @see WP_Customize_Nav_Menu_Item_Setting::preview() 402 402 */ 403 function test_preview_inserted() {403 public function test_preview_inserted() { 404 404 do_action( 'customize_register', $this->wp_customize ); 405 405 … … 460 460 * @see WP_Customize_Nav_Menu_Item_Setting::preview() 461 461 */ 462 function test_preview_deleted() {462 public function test_preview_deleted() { 463 463 do_action( 'customize_register', $this->wp_customize ); 464 464 … … 500 500 * @see WP_Customize_Nav_Menu_Item_Setting::sanitize() 501 501 */ 502 function test_sanitize() {502 public function test_sanitize() { 503 503 do_action( 'customize_register', $this->wp_customize ); 504 504 … … 638 638 * @see WP_Customize_Nav_Menu_Item_Setting::update() 639 639 */ 640 function test_save_updated() {640 public function test_save_updated() { 641 641 do_action( 'customize_register', $this->wp_customize ); 642 642 … … 707 707 * @see WP_Customize_Nav_Menu_Item_Setting::update() 708 708 */ 709 function test_save_inserted() {709 public function test_save_inserted() { 710 710 do_action( 'customize_register', $this->wp_customize ); 711 711 … … 780 780 * @see WP_Customize_Nav_Menu_Item_Setting::update() 781 781 */ 782 function test_save_deleted() {782 public function test_save_deleted() { 783 783 do_action( 'customize_register', $this->wp_customize ); 784 784 … … 832 832 * @ticket 33665 833 833 */ 834 function test_invalid_nav_menu_item() {834 public function test_invalid_nav_menu_item() { 835 835 $menu_id = wp_create_nav_menu( 'Primary' ); 836 836 register_post_type( … … 889 889 * @see WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() 890 890 */ 891 function test_value_as_wp_post_nav_menu_item() {891 public function test_value_as_wp_post_nav_menu_item() { 892 892 $post_id = self::factory()->post->create(); 893 893 … … 950 950 * @covers WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item 951 951 */ 952 function test_value_as_wp_post_nav_menu_item_term_urls() {952 public function test_value_as_wp_post_nav_menu_item_term_urls() { 953 953 $term_id = self::factory()->term->create( array( 'taxonomy' => 'category' ) ); 954 954 register_post_type( … … 1023 1023 * @covers WP_Customize_Nav_Menu_Item_Setting::get_original_title 1024 1024 */ 1025 function test_get_original_title() {1025 public function test_get_original_title() { 1026 1026 $menu_id = wp_create_nav_menu( 'Menu' ); 1027 1027 register_post_type( … … 1218 1218 * @see WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() 1219 1219 */ 1220 function test_value_as_wp_post_nav_menu_item_with_empty_title() {1220 public function test_value_as_wp_post_nav_menu_item_with_empty_title() { 1221 1221 $original_title = 'The Original Title'; 1222 1222 $post_id = self::factory()->post->create( array( 'post_title' => $original_title ) );
Note: See TracChangeset
for help on using the changeset viewer.