| @@ 80-90 (lines=11) @@ | ||
| 77 | * @see WP_Customize_Panel::active() |
|
| 78 | * @see WP_Customize_Panel::active_callback() |
|
| 79 | */ |
|
| 80 | function test_active() { |
|
| 81 | $panel = new WP_Customize_Panel( $this->manager, 'foo' ); |
|
| 82 | $this->assertTrue( $panel->active() ); |
|
| 83 | ||
| 84 | $panel = new WP_Customize_Panel( $this->manager, 'foo', array( |
|
| 85 | 'active_callback' => '__return_false', |
|
| 86 | ) ); |
|
| 87 | $this->assertFalse( $panel->active() ); |
|
| 88 | add_filter( 'customize_panel_active', array( $this, 'filter_active_test' ), 10, 2 ); |
|
| 89 | $this->assertTrue( $panel->active() ); |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * @param bool $active |
|
| @@ 83-93 (lines=11) @@ | ||
| 80 | * @see WP_Customize_Section::active() |
|
| 81 | * @see WP_Customize_Section::active_callback() |
|
| 82 | */ |
|
| 83 | function test_active() { |
|
| 84 | $section = new WP_Customize_Section( $this->manager, 'foo' ); |
|
| 85 | $this->assertTrue( $section->active() ); |
|
| 86 | ||
| 87 | $section = new WP_Customize_Section( $this->manager, 'foo', array( |
|
| 88 | 'active_callback' => '__return_false', |
|
| 89 | ) ); |
|
| 90 | $this->assertFalse( $section->active() ); |
|
| 91 | add_filter( 'customize_section_active', array( $this, 'filter_active_test' ), 10, 2 ); |
|
| 92 | $this->assertTrue( $section->active() ); |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * @param bool $active |
|