- Timestamp:
- 01/09/2024 11:30:10 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpGetGlobalStylesheet.php
r56978 r57259 20 20 21 21 /** 22 * Flag to indicate whether to remove 'border' theme support at tear_down(). 23 * 24 * @var bool 25 */ 26 private $remove_border_support_at_teardown = false; 27 28 /** 22 29 * Flag to indicate whether to switch back to the default theme at tear down. 23 30 * … … 41 48 } 42 49 50 if ( $this->remove_border_support_at_teardown ) { 51 $this->remove_border_support_at_teardown = false; 52 remove_theme_support( 'border' ); 53 remove_theme_support( 'editor-color-palette' ); 54 } 55 43 56 parent::tear_down(); 44 57 } … … 248 261 249 262 /** 263 * Tests that theme color palette presets are output when appearance tools are enabled via theme support. 264 * 265 * @ticket 60134 266 */ 267 public function test_theme_color_palette_presets_output_when_border_support_enabled() { 268 269 $args = array( 270 array( 271 'name' => 'Black', 272 'slug' => 'nice-black', 273 'color' => '#000000', 274 ), 275 array( 276 'name' => 'Dark Gray', 277 'slug' => 'dark-gray', 278 'color' => '#28303D', 279 ), 280 array( 281 'name' => 'Green', 282 'slug' => 'haunted-green', 283 'color' => '#D1E4DD', 284 ), 285 array( 286 'name' => 'Blue', 287 'slug' => 'soft-blue', 288 'color' => '#D1DFE4', 289 ), 290 array( 291 'name' => 'Purple', 292 'slug' => 'cool-purple', 293 'color' => '#D1D1E4', 294 ), 295 ); 296 297 // Add theme support for appearance tools. 298 add_theme_support( 'border' ); 299 add_theme_support( 'editor-color-palette', $args ); 300 $this->remove_border_support_at_teardown = true; 301 302 // Check for both the variable declaration and its use as a value. 303 $variables = wp_get_global_stylesheet( array( 'variables' ) ); 304 305 $this->assertStringContainsString( '--wp--preset--color--nice-black: #000000', $variables ); 306 $this->assertStringContainsString( '--wp--preset--color--dark-gray: #28303D', $variables ); 307 $this->assertStringContainsString( '--wp--preset--color--haunted-green: #D1E4DD', $variables ); 308 $this->assertStringContainsString( '--wp--preset--color--soft-blue: #D1DFE4', $variables ); 309 $this->assertStringContainsString( '--wp--preset--color--cool-purple: #D1D1E4', $variables ); 310 311 $presets = wp_get_global_stylesheet( array( 'presets' ) ); 312 313 $this->assertStringContainsString( 'var(--wp--preset--color--nice-black)', $presets ); 314 $this->assertStringContainsString( 'var(--wp--preset--color--dark-gray)', $presets ); 315 $this->assertStringContainsString( 'var(--wp--preset--color--haunted-green)', $presets ); 316 $this->assertStringContainsString( 'var(--wp--preset--color--soft-blue)', $presets ); 317 $this->assertStringContainsString( 'var(--wp--preset--color--cool-purple)', $presets ); 318 } 319 320 /** 250 321 * Adds the 'editor-font-sizes' theme support with custom font sizes. 251 322 *
Note: See TracChangeset
for help on using the changeset viewer.