@@ 112-125 (lines=14) @@ | ||
109 | /** |
|
110 | * Test empty constructor. |
|
111 | */ |
|
112 | function test_construct_empty_menus() { |
|
113 | do_action( 'customize_register', $this->wp_customize ); |
|
114 | $_wp_customize = $this->wp_customize; |
|
115 | unset($_wp_customize->nav_menus); |
|
116 | ||
117 | $exception = null; |
|
118 | try { |
|
119 | $bad_setting = new WP_Customize_Nav_Menu_Item_Setting( $_wp_customize, 'nav_menu_item[123]' ); |
|
120 | unset( $bad_setting ); |
|
121 | } catch ( Exception $e ) { |
|
122 | $exception = $e; |
|
123 | } |
|
124 | $this->assertInstanceOf( 'Exception', $exception ); |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * Test constructor for placeholder (draft) menu. |
@@ 95-108 (lines=14) @@ | ||
92 | /** |
|
93 | * Test empty constructor. |
|
94 | */ |
|
95 | function test_construct_empty_menus() { |
|
96 | do_action( 'customize_register', $this->wp_customize ); |
|
97 | $_wp_customize = $this->wp_customize; |
|
98 | unset( $_wp_customize->nav_menus ); |
|
99 | ||
100 | $exception = null; |
|
101 | try { |
|
102 | $bad_setting = new WP_Customize_Nav_Menu_Setting( $_wp_customize, 'nav_menu_item[123]' ); |
|
103 | unset( $bad_setting ); |
|
104 | } catch ( Exception $e ) { |
|
105 | $exception = $e; |
|
106 | } |
|
107 | $this->assertInstanceOf( 'Exception', $exception ); |
|
108 | } |
|
109 | ||
110 | /** |
|
111 | * Test constructor for placeholder (draft) menu. |