Changeset 52677 for trunk/tests/phpunit/tests/theme/globalStylesheet.php
- Timestamp:
- 02/04/2022 02:33:33 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/globalStylesheet.php
r52675 r52677 47 47 48 48 $styles = wp_get_global_stylesheet( array( 'variables' ) ); 49 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is 13px' );50 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );51 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is 36px' );52 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is 42px' );53 $this->assert True( str_contains( $styles, '--wp--preset--font-size--custom: 100px;' ), 'custom font size is 100px' );49 $this->assertStringContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is 13px' ); 50 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 51 $this->assertStringContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is 36px' ); 52 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is 42px' ); 53 $this->assertStringContainsString( '--wp--preset--font-size--custom: 100px;', $styles, 'custom font size is 100px' ); 54 54 55 55 switch_theme( WP_DEFAULT_THEME ); … … 60 60 61 61 $styles = wp_get_global_stylesheet( array( 'presets' ) ); 62 $this->assert False( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is not present' );63 $this->assert False( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is not present' );64 $this->assert False( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is not present' );65 $this->assert False( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is not present' );66 $this->assert False( str_contains( $styles, '--wp--preset--font-size--custom: 100px;' ), 'custom font size is not present' );62 $this->assertStringNotContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is not present' ); 63 $this->assertStringNotContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is not present' ); 64 $this->assertStringNotContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is not present' ); 65 $this->assertStringNotContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is not present' ); 66 $this->assertStringNotContainsString( '--wp--preset--font-size--custom: 100px;', $styles, 'custom font size is not present' ); 67 67 68 68 switch_theme( WP_DEFAULT_THEME ); … … 73 73 74 74 $styles = wp_get_global_stylesheet(); 75 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is 13px' );76 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );77 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is 36px' );78 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is 42px' );79 $this->assert True( str_contains( $styles, '--wp--preset--font-size--custom: 100px;' ), 'custom font size is 100px' );75 $this->assertStringContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is 13px' ); 76 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 77 $this->assertStringContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is 36px' ); 78 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is 42px' ); 79 $this->assertStringContainsString( '--wp--preset--font-size--custom: 100px;', $styles, 'custom font size is 100px' ); 80 80 81 81 switch_theme( WP_DEFAULT_THEME ); … … 84 84 public function test_variables_in_classic_theme_with_no_presets_using_variables() { 85 85 $styles = wp_get_global_stylesheet( array( 'variables' ) ); 86 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is 13px' );87 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );88 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is 36px' );89 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is 42px' );86 $this->assertStringContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is 13px' ); 87 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 88 $this->assertStringContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is 36px' ); 89 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is 42px' ); 90 90 } 91 91 92 92 public function test_variables_in_classic_theme_with_no_presets_using_presets() { 93 93 $styles = wp_get_global_stylesheet( array( 'presets' ) ); 94 $this->assert False( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is not present' );95 $this->assert False( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is not present' );96 $this->assert False( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is not present' );97 $this->assert False( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is not present' );94 $this->assertStringNotContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is not present' ); 95 $this->assertStringNotContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is not present' ); 96 $this->assertStringNotContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is not present' ); 97 $this->assertStringNotContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is not present' ); 98 98 } 99 99 100 100 public function test_variables_in_classic_theme_with_no_presets_using_defaults() { 101 101 $styles = wp_get_global_stylesheet(); 102 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 13px' ), 'small font size is 13px' );103 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );104 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 36px' ), 'large font size is 36px' );105 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is 42px' );102 $this->assertStringContainsString( '--wp--preset--font-size--small: 13px', $styles, 'small font size is 13px' ); 103 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 104 $this->assertStringContainsString( '--wp--preset--font-size--large: 36px', $styles, 'large font size is 36px' ); 105 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is 42px' ); 106 106 } 107 107 … … 124 124 125 125 $styles = wp_get_global_stylesheet( array( 'variables' ) ); 126 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 18px' ), 'small font size is 18px' );127 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );128 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 26.25px' ), 'large font size is 26.25px' );129 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is 42px' );126 $this->assertStringContainsString( '--wp--preset--font-size--small: 18px', $styles, 'small font size is 18px' ); 127 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 128 $this->assertStringContainsString( '--wp--preset--font-size--large: 26.25px', $styles, 'large font size is 26.25px' ); 129 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is 42px' ); 130 130 131 131 remove_theme_support( 'editor-font-sizes' ); … … 150 150 151 151 $styles = wp_get_global_stylesheet( array( 'presets' ) ); 152 $this->assert False( str_contains( $styles, '--wp--preset--font-size--small: 18px' ), 'small font size is not present' );153 $this->assert False( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is not present' );154 $this->assert False( str_contains( $styles, '--wp--preset--font-size--large: 26.25px' ), 'large font size is not present' );155 $this->assert False( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'x-large font size is not present' );152 $this->assertStringNotContainsString( '--wp--preset--font-size--small: 18px', $styles, 'small font size is not present' ); 153 $this->assertStringNotContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is not present' ); 154 $this->assertStringNotContainsString( '--wp--preset--font-size--large: 26.25px', $styles, 'large font size is not present' ); 155 $this->assertStringNotContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'x-large font size is not present' ); 156 156 157 157 remove_theme_support( 'editor-font-sizes' ); … … 176 176 177 177 $styles = wp_get_global_stylesheet(); 178 $this->assert True( str_contains( $styles, '--wp--preset--font-size--small: 18px' ), 'small font size is 18px' );179 $this->assert True( str_contains( $styles, '--wp--preset--font-size--medium: 20px' ), 'medium font size is 20px' );180 $this->assert True( str_contains( $styles, '--wp--preset--font-size--large: 26.25px' ), 'large font size is 26.25px' );181 $this->assert True( str_contains( $styles, '--wp--preset--font-size--x-large: 42px' ), 'small font size is 42px' );178 $this->assertStringContainsString( '--wp--preset--font-size--small: 18px', $styles, 'small font size is 18px' ); 179 $this->assertStringContainsString( '--wp--preset--font-size--medium: 20px', $styles, 'medium font size is 20px' ); 180 $this->assertStringContainsString( '--wp--preset--font-size--large: 26.25px', $styles, 'large font size is 26.25px' ); 181 $this->assertStringContainsString( '--wp--preset--font-size--x-large: 42px', $styles, 'small font size is 42px' ); 182 182 183 183 remove_theme_support( 'editor-font-sizes' );
Note: See TracChangeset
for help on using the changeset viewer.