Changeset 38901 for trunk/tests/phpunit/tests/general/template.php
- Timestamp:
- 10/25/2016 04:46:36 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/general/template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/template.php
r38786 r38901 24 24 25 25 function tearDown() { 26 global $wp_customize; 26 27 $this->_remove_custom_logo(); 28 $this->_remove_site_icon(); 29 $wp_customize = null; 27 30 28 31 parent::tearDown(); … … 52 55 $this->expectOutputString( $this->site_icon_url ); 53 56 site_icon_url(); 54 $this->_remove_site_icon();55 57 } 56 58 … … 118 120 $this->expectOutputString( $output ); 119 121 wp_site_icon(); 120 121 $this->_remove_site_icon();122 122 } 123 123 … … 144 144 wp_site_icon(); 145 145 remove_filter( 'site_icon_meta_tags', array( $this, '_custom_site_icon_meta_tag' ) ); 146 147 $this->_remove_site_icon(); 146 } 147 148 /** 149 * @group site_icon 150 * @ticket 38377 151 */ 152 function test_customize_preview_wp_site_icon_empty() { 153 global $wp_customize; 154 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 155 156 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; 157 $wp_customize = new WP_Customize_Manager(); 158 $wp_customize->register_controls(); 159 $wp_customize->start_previewing_theme(); 160 161 $this->expectOutputString( '<link rel="icon" href="/favicon.ico" sizes="32x32" />' . "\n" ); 162 wp_site_icon(); 163 } 164 165 /** 166 * @group site_icon 167 * @ticket 38377 168 */ 169 function test_customize_preview_wp_site_icon_dirty() { 170 global $wp_customize; 171 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 172 173 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; 174 $wp_customize = new WP_Customize_Manager(); 175 $wp_customize->register_controls(); 176 $wp_customize->start_previewing_theme(); 177 178 $attachment_id = $this->_insert_attachment(); 179 $wp_customize->set_post_value( 'site_icon', $attachment_id ); 180 $wp_customize->get_setting( 'site_icon' )->preview(); 181 $output = array( 182 sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( wp_get_attachment_image_url( $attachment_id, 32 ) ) ), 183 sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( wp_get_attachment_image_url( $attachment_id, 192 ) ) ), 184 sprintf( '<link rel="apple-touch-icon-precomposed" href="%s" />', esc_url( wp_get_attachment_image_url( $attachment_id, 180 ) ) ), 185 sprintf( '<meta name="msapplication-TileImage" content="%s" />', esc_url( wp_get_attachment_image_url( $attachment_id, 270 ) ) ), 186 '', 187 ); 188 $output = implode( "\n", $output ); 189 $this->expectOutputString( $output ); 190 wp_site_icon(); 148 191 } 149 192
Note: See TracChangeset
for help on using the changeset viewer.