Changeset 52010 for trunk/tests/phpunit/tests/customize/nav-menus.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/nav-menus.php
r51569 r52010 20 20 * @see WP_UnitTestCase::setup() 21 21 */ 22 function set_up() {22 public function set_up() { 23 23 parent::set_up(); 24 24 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 array Menu item types. 45 45 */ 46 function filter_item_types( $items ) {46 public function filter_item_types( $items ) { 47 47 $items[] = array( 48 48 'title' => 'Custom', … … 63 63 * @return array Menu items. 64 64 */ 65 function filter_items( $items, $type, $object ) {65 public function filter_items( $items, $type, $object ) { 66 66 $items[] = array( 67 67 'id' => 'custom-1', … … 82 82 * @see WP_Customize_Nav_Menus::__construct() 83 83 */ 84 function test_construct() {84 public function test_construct() { 85 85 do_action( 'customize_register', $this->wp_customize ); 86 86 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 108 108 * @see WP_Customize_Nav_Menus::load_available_items_query() 109 109 */ 110 function test_load_available_items_query_returns_wp_error() {110 public function test_load_available_items_query_returns_wp_error() { 111 111 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 112 112 … … 127 127 * @see WP_Customize_Nav_Menus::load_available_items_query() 128 128 */ 129 function test_load_available_items_query_maybe_returns_home() {129 public function test_load_available_items_query_maybe_returns_home() { 130 130 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 131 131 … … 158 158 * @see WP_Customize_Nav_Menus::load_available_items_query() 159 159 */ 160 function test_load_available_items_query_returns_post_item_with_page_number() {160 public function test_load_available_items_query_returns_post_item_with_page_number() { 161 161 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 162 162 … … 188 188 * @see WP_Customize_Nav_Menus::load_available_items_query() 189 189 */ 190 function test_load_available_items_query_returns_page_item() {190 public function test_load_available_items_query_returns_page_item() { 191 191 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 192 192 … … 219 219 * @see WP_Customize_Nav_Menus::load_available_items_query() 220 220 */ 221 function test_load_available_items_query_returns_post_item() {221 public function test_load_available_items_query_returns_post_item() { 222 222 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 223 223 … … 245 245 * @see WP_Customize_Nav_Menus::load_available_items_query() 246 246 */ 247 function test_load_available_items_query_returns_term_item() {247 public function test_load_available_items_query_returns_term_item() { 248 248 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 249 249 … … 271 271 * @see WP_Customize_Nav_Menus::load_available_items_query() 272 272 */ 273 function test_load_available_items_query_returns_custom_item() {273 public function test_load_available_items_query_returns_custom_item() { 274 274 add_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) ); 275 275 add_filter( 'customize_nav_menu_available_items', array( $this, 'filter_items' ), 10, 4 ); … … 296 296 * @see WP_Customize_Nav_Menus::search_available_items_query() 297 297 */ 298 function test_search_available_items_query() {298 public function test_search_available_items_query() { 299 299 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 300 300 do_action( 'customize_register', $this->wp_customize ); … … 465 465 * @return array Items. 466 466 */ 467 function filter_search( $items, $args ) {467 public function filter_search( $items, $args ) { 468 468 $this->assertIsArray( $items ); 469 469 $this->assertIsArray( $args ); … … 493 493 * @see WP_Customize_Nav_Menus::enqueue_scripts() 494 494 */ 495 function test_enqueue_scripts() {495 public function test_enqueue_scripts() { 496 496 do_action( 'customize_register', $this->wp_customize ); 497 497 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 508 508 * @see WP_Customize_Nav_Menus::filter_dynamic_setting_args() 509 509 */ 510 function test_filter_dynamic_setting_args() {510 public function test_filter_dynamic_setting_args() { 511 511 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 512 512 … … 525 525 * @see WP_Customize_Nav_Menus::filter_dynamic_setting_class() 526 526 */ 527 function test_filter_dynamic_setting_class() {527 public function test_filter_dynamic_setting_class() { 528 528 do_action( 'customize_register', $this->wp_customize ); 529 529 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 543 543 * @see WP_Customize_Nav_Menus::customize_register() 544 544 */ 545 function test_customize_register() {545 public function test_customize_register() { 546 546 do_action( 'customize_register', $this->wp_customize ); 547 547 $menu_id = wp_create_nav_menu( 'Primary' ); … … 575 575 * @see WP_Customize_Nav_Menus::intval_base10() 576 576 */ 577 function test_intval_base10() {577 public function test_intval_base10() { 578 578 579 579 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 594 594 * @see WP_Customize_Nav_Menus::available_item_types() 595 595 */ 596 function test_available_item_types() {596 public function test_available_item_types() { 597 597 598 598 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 730 730 * @see WP_Customize_Nav_Menus::print_templates() 731 731 */ 732 function test_print_templates() {732 public function test_print_templates() { 733 733 do_action( 'customize_register', $this->wp_customize ); 734 734 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 754 754 * @see WP_Customize_Nav_Menus::available_items_template() 755 755 */ 756 function test_available_items_template() {756 public function test_available_items_template() { 757 757 add_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) ); 758 758 do_action( 'customize_register', $this->wp_customize ); … … 801 801 * @see WP_Customize_Nav_Menus::customize_dynamic_partial_args() 802 802 */ 803 function test_customize_dynamic_partial_args() {803 public function test_customize_dynamic_partial_args() { 804 804 do_action( 'customize_register', $this->wp_customize ); 805 805 … … 823 823 * @see WP_Customize_Nav_Menus::customize_preview_init() 824 824 */ 825 function test_customize_preview_init() {825 public function test_customize_preview_init() { 826 826 do_action( 'customize_register', $this->wp_customize ); 827 827 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 838 838 * @covers WP_Customize_Nav_Menus::make_auto_draft_status_previewable 839 839 */ 840 function test_make_auto_draft_status_previewable() {840 public function test_make_auto_draft_status_previewable() { 841 841 global $wp_post_statuses; 842 842 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 850 850 * @covers WP_Customize_Nav_Menus::sanitize_nav_menus_created_posts 851 851 */ 852 function test_sanitize_nav_menus_created_posts() {852 public function test_sanitize_nav_menus_created_posts() { 853 853 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 854 854 $contributor_user_id = $this->factory()->user->create( array( 'role' => 'contributor' ) ); … … 924 924 * @covers WP_Customize_Nav_Menus::save_nav_menus_created_posts 925 925 */ 926 function test_save_nav_menus_created_posts() {926 public function test_save_nav_menus_created_posts() { 927 927 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); 928 928 do_action( 'customize_register', $this->wp_customize ); … … 1032 1032 * @see WP_Customize_Nav_Menus::filter_wp_nav_menu_args() 1033 1033 */ 1034 function test_filter_wp_nav_menu_args() {1034 public function test_filter_wp_nav_menu_args() { 1035 1035 do_action( 'customize_register', $this->wp_customize ); 1036 1036 $menus = $this->wp_customize->nav_menus; … … 1118 1118 * @covers WP_Customize_Nav_Menus::filter_wp_nav_menu_args 1119 1119 */ 1120 function test_filter_wp_nav_menu() {1120 public function test_filter_wp_nav_menu() { 1121 1121 do_action( 'customize_register', $this->wp_customize ); 1122 1122 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 1159 1159 * @see WP_Customize_Nav_Menus::customize_preview_enqueue_deps() 1160 1160 */ 1161 function test_customize_preview_enqueue_deps() {1161 public function test_customize_preview_enqueue_deps() { 1162 1162 do_action( 'customize_register', $this->wp_customize ); 1163 1163 $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); … … 1173 1173 * @see WP_Customize_Nav_Menus::export_preview_data() 1174 1174 */ 1175 function test_export_preview_data() {1175 public function test_export_preview_data() { 1176 1176 ob_start(); 1177 1177 $this->wp_customize->nav_menus->export_preview_data(); … … 1187 1187 * @see WP_Customize_Nav_Menus::render_nav_menu_partial() 1188 1188 */ 1189 function test_render_nav_menu_partial() {1189 public function test_render_nav_menu_partial() { 1190 1190 $this->wp_customize->nav_menus->customize_preview_init(); 1191 1191
Note: See TracChangeset
for help on using the changeset viewer.