You appear to be a bot. Output may be restricted
Description
Test constructor.
Usage
Test_WP_Customize_Nav_Menu_Setting::test_construct();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/nav-menu-setting.php
Lines:
1 to 28 of 28
public function test_construct() { do_action( 'customize_register', $this->wp_customize ); $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'nav_menu[123]' ); $this->assertSame( 'nav_menu', $setting->type ); $this->assertSame( 'postMessage', $setting->transport ); $this->assertSame( 123, $setting->term_id ); $this->assertNull( $setting->previous_term_id ); $this->assertNull( $setting->update_status ); $this->assertNull( $setting->update_error ); $this->assertIsArray( $setting->default ); foreach ( array( 'name', 'description', 'parent' ) as $key ) { $this->assertArrayHasKey( $key, $setting->default ); } $this->assertSame( '', $setting->default['name'] ); $this->assertSame( '', $setting->default['description'] ); $this->assertSame( 0, $setting->default['parent'] ); $exception = null; try { $bad_setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'foo_bar_baz' ); unset( $bad_setting ); } catch ( Exception $e ) { $exception = $e; } $this->assertInstanceOf( 'Exception', $exception ); }