| @@ 2457-2479 (lines=23) @@ | ||
| 2454 | /** |
|
| 2455 | * @ticket 34596 |
|
| 2456 | */ |
|
| 2457 | function test_add_section_return_instance() |
|
| 2458 | { |
|
| 2459 | $manager = new WP_Customize_Manager(); |
|
| 2460 | wp_set_current_user(self::$admin_user_id); |
|
| 2461 | ||
| 2462 | $section_id = 'foo-section'; |
|
| 2463 | $result_section = $manager->add_section( |
|
| 2464 | $section_id, array( |
|
| 2465 | 'title' => 'Section', |
|
| 2466 | 'priority' => 1, |
|
| 2467 | ) |
|
| 2468 | ); |
|
| 2469 | ||
| 2470 | $this->assertInstanceOf('WP_Customize_Section', $result_section); |
|
| 2471 | $this->assertEquals($section_id, $result_section->id); |
|
| 2472 | ||
| 2473 | $section = new WP_Customize_Section( |
|
| 2474 | $manager, $section_id, array( |
|
| 2475 | 'title' => 'Section 2', |
|
| 2476 | 'priority' => 2, |
|
| 2477 | ) |
|
| 2478 | ); |
|
| 2479 | $result_section = $manager->add_section($section); |
|
| 2480 | ||
| 2481 | $this->assertInstanceOf('WP_Customize_Section', $result_section); |
|
| 2482 | $this->assertEquals($section_id, $result_section->id); |
|
| @@ 2564-2585 (lines=22) @@ | ||
| 2561 | /** |
|
| 2562 | * @ticket 34596 |
|
| 2563 | */ |
|
| 2564 | function test_add_panel_return_instance() |
|
| 2565 | { |
|
| 2566 | $manager = new WP_Customize_Manager(); |
|
| 2567 | wp_set_current_user(self::$admin_user_id); |
|
| 2568 | ||
| 2569 | $panel_id = 'foo-panel'; |
|
| 2570 | $result_panel = $manager->add_panel( |
|
| 2571 | $panel_id, array( |
|
| 2572 | 'title' => 'Test Panel', |
|
| 2573 | 'priority' => 2, |
|
| 2574 | ) |
|
| 2575 | ); |
|
| 2576 | ||
| 2577 | $this->assertInstanceOf('WP_Customize_Panel', $result_panel); |
|
| 2578 | $this->assertEquals($panel_id, $result_panel->id); |
|
| 2579 | ||
| 2580 | $panel = new WP_Customize_Panel( |
|
| 2581 | $manager, $panel_id, array( |
|
| 2582 | 'title' => 'Test Panel 2', |
|
| 2583 | ) |
|
| 2584 | ); |
|
| 2585 | $result_panel = $manager->add_panel($panel); |
|
| 2586 | ||
| 2587 | $this->assertInstanceOf('WP_Customize_Panel', $result_panel); |
|
| 2588 | $this->assertEquals($panel, $result_panel); |
|