| @@ 132-143 (lines=12) @@ | ||
| 129 | * |
|
| 130 | * @see WP_Customize_Nav_Menu_Item_Setting::__construct() |
|
| 131 | */ |
|
| 132 | function test_construct_placeholder() { |
|
| 133 | do_action( 'customize_register', $this->wp_customize ); |
|
| 134 | $default = array( |
|
| 135 | 'title' => 'Lorem', |
|
| 136 | 'description' => 'ipsum', |
|
| 137 | 'menu_item_parent' => 123, |
|
| 138 | ); |
|
| 139 | $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, 'nav_menu_item[-5]', compact( 'default' ) ); |
|
| 140 | $this->assertEquals( -5, $setting->post_id ); |
|
| 141 | $this->assertNull( $setting->previous_post_id ); |
|
| 142 | $this->assertEquals( $default, $setting->default ); |
|
| 143 | } |
|
| 144 | ||
| 145 | /** |
|
| 146 | * Test value method with post. |
|
| @@ 115-125 (lines=11) @@ | ||
| 112 | * |
|
| 113 | * @see WP_Customize_Nav_Menu_Setting::__construct() |
|
| 114 | */ |
|
| 115 | function test_construct_placeholder() { |
|
| 116 | do_action( 'customize_register', $this->wp_customize ); |
|
| 117 | $default = array( |
|
| 118 | 'name' => 'Lorem', |
|
| 119 | 'description' => 'ipsum', |
|
| 120 | 'parent' => 123, |
|
| 121 | ); |
|
| 122 | $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'nav_menu[-5]', compact( 'default' ) ); |
|
| 123 | $this->assertEquals( -5, $setting->term_id ); |
|
| 124 | $this->assertEquals( $default, $setting->default ); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * Test value method. |
|