Changeset 51305
- Timestamp:
- 07/02/2021 12:24:08 PM (3 years ago)
- Location:
- branches/5.8
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
-
branches/5.8/tests/phpunit/tests/rest-api/rest-sidebars-controller.php
r51235 r51305 63 63 } 64 64 65 function clean_up_global_scope() {65 public function clean_up_global_scope() { 66 66 global $wp_widget_factory, $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates; 67 67 -
branches/5.8/tests/phpunit/tests/theme/wpTheme.php
r50967 r51305 10 10 */ 11 11 class Tests_Theme_wpTheme extends WP_UnitTestCase { 12 function setUp() { 12 13 public function setUp() { 13 14 parent::setUp(); 14 15 $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' ); … … 25 26 } 26 27 27 function tearDown() {28 public function tearDown() { 28 29 $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 29 30 wp_clean_themes_cache(); … … 33 34 34 35 // Replace the normal theme root directory with our premade test directory. 35 function _theme_root( $dir ) {36 public function _theme_root( $dir ) { 36 37 return $this->theme_root; 37 38 } 38 function test_new_WP_Theme_top_level() { 39 40 public function test_new_WP_Theme_top_level() { 39 41 $theme = new WP_Theme( 'theme1', $this->theme_root ); 40 42 … … 55 57 } 56 58 57 function test_new_WP_Theme_subdir() {59 public function test_new_WP_Theme_subdir() { 58 60 $theme = new WP_Theme( 'subdir/theme2', $this->theme_root ); 59 61 … … 77 79 * @ticket 20313 78 80 */ 79 function test_new_WP_Theme_subdir_bad_root() {81 public function test_new_WP_Theme_subdir_bad_root() { 80 82 // This is what get_theme_data() does when you pass it a style.css file for a theme in a subdirectory. 81 83 $theme = new WP_Theme( 'theme2', $this->theme_root . '/subdir' ); … … 100 102 * @ticket 21749 101 103 */ 102 function test_wp_theme_uris_with_spaces() {104 public function test_wp_theme_uris_with_spaces() { 103 105 $theme = new WP_Theme( 'theme with spaces', $this->theme_root . '/subdir' ); 104 106 // Make sure subdir/ is considered part of the stylesheet, as we must avoid encoding /'s. … … 117 119 * @ticket 21969 118 120 */ 119 function test_theme_uris_with_spaces() {121 public function test_theme_uris_with_spaces() { 120 122 $callback = array( $this, 'filter_theme_with_spaces' ); 121 123 add_filter( 'stylesheet', $callback ); … … 129 131 } 130 132 131 function filter_theme_with_spaces() {133 public function filter_theme_with_spaces() { 132 134 return 'subdir/theme with spaces'; 133 135 } … … 136 138 * @ticket 26873 137 139 */ 138 function test_display_method_on_get_method_failure() {140 public function test_display_method_on_get_method_failure() { 139 141 $theme = new WP_Theme( 'nonexistent', $this->theme_root ); 140 142 $this->assertSame( 'nonexistent', $theme->get( 'Name' ) ); … … 147 149 * @ticket 40820 148 150 */ 149 function test_child_theme_with_itself_as_parent_should_appear_as_broken() {151 public function test_child_theme_with_itself_as_parent_should_appear_as_broken() { 150 152 $theme = new WP_Theme( 'child-parent-itself', $this->theme_root ); 151 153 $errors = $theme->errors(); … … 161 163 * @group ms-required 162 164 */ 163 function test_wp_theme_network_enable_single_theme() {165 public function test_wp_theme_network_enable_single_theme() { 164 166 $theme = 'testtheme-1'; 165 167 $current_allowed_themes = get_site_option( 'allowedthemes' ); … … 178 180 * @group ms-required 179 181 */ 180 function test_wp_theme_network_enable_multiple_themes() {182 public function test_wp_theme_network_enable_multiple_themes() { 181 183 $themes = array( 'testtheme-2', 'testtheme-3' ); 182 184 $current_allowed_themes = get_site_option( 'allowedthemes' ); … … 201 203 * @group ms-required 202 204 */ 203 function test_network_disable_single_theme() {205 public function test_network_disable_single_theme() { 204 206 $current_allowed_themes = get_site_option( 'allowedthemes' ); 205 207 … … 226 228 * @group ms-required 227 229 */ 228 function test_network_disable_multiple_themes() {230 public function test_network_disable_multiple_themes() { 229 231 $current_allowed_themes = get_site_option( 'allowedthemes' ); 230 232 -
branches/5.8/tests/phpunit/tests/theme/wpThemeJson.php
r51198 r51305 17 17 * @ticket 52991 18 18 */ 19 function test_get_settings() {19 public function test_get_settings() { 20 20 $theme_json = new WP_Theme_JSON( 21 21 array( … … 65 65 } 66 66 67 function test_get_settings_presets_are_keyed_by_origin() {67 public function test_get_settings_presets_are_keyed_by_origin() { 68 68 $core_origin = new WP_Theme_JSON( 69 69 array( … … 190 190 } 191 191 192 function test_get_stylesheet() {192 public function test_get_stylesheet() { 193 193 $theme_json = new WP_Theme_JSON( 194 194 array( … … 308 308 } 309 309 310 function test_get_stylesheet_preset_classes_work_with_compounded_selectors() {310 public function test_get_stylesheet_preset_classes_work_with_compounded_selectors() { 311 311 $theme_json = new WP_Theme_JSON( 312 312 array( … … 335 335 } 336 336 337 function test_get_stylesheet_preset_rules_come_after_block_rules() {337 public function test_get_stylesheet_preset_rules_come_after_block_rules() { 338 338 $theme_json = new WP_Theme_JSON( 339 339 array( … … 656 656 * @ticket 52991 657 657 */ 658 function test_get_from_editor_settings() {658 public function test_get_from_editor_settings() { 659 659 $input = array( 660 660 'disableCustomColors' => true, … … 732 732 * @ticket 52991 733 733 */ 734 function test_get_editor_settings_no_theme_support() {734 public function test_get_editor_settings_no_theme_support() { 735 735 $input = array( 736 736 '__unstableEnableFullSiteEditingBlocks' => false, … … 787 787 * @ticket 52991 788 788 */ 789 function test_get_editor_settings_blank() {789 public function test_get_editor_settings_blank() { 790 790 $expected = array( 791 791 'version' => WP_Theme_JSON::LATEST_SCHEMA, … … 800 800 * @ticket 52991 801 801 */ 802 function test_get_editor_settings_custom_units_can_be_disabled() {802 public function test_get_editor_settings_custom_units_can_be_disabled() { 803 803 add_theme_support( 'custom-units', array() ); 804 804 $input = get_default_block_editor_settings(); … … 817 817 * @ticket 52991 818 818 */ 819 function test_get_editor_settings_custom_units_can_be_enabled() {819 public function test_get_editor_settings_custom_units_can_be_enabled() { 820 820 add_theme_support( 'custom-units' ); 821 821 $input = get_default_block_editor_settings(); … … 834 834 * @ticket 52991 835 835 */ 836 function test_get_editor_settings_custom_units_can_be_filtered() {836 public function test_get_editor_settings_custom_units_can_be_filtered() { 837 837 add_theme_support( 'custom-units', 'rem', 'em' ); 838 838 $input = get_default_block_editor_settings(); -
branches/5.8/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r51196 r51305 13 13 class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 14 14 15 function setUp() {15 public function setUp() { 16 16 parent::setUp(); 17 17 $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' ); … … 30 30 } 31 31 32 function tearDown() {32 public function tearDown() { 33 33 $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 34 34 wp_clean_themes_cache(); … … 37 37 } 38 38 39 function filter_set_theme_root() {39 public function filter_set_theme_root() { 40 40 return $this->theme_root; 41 41 } 42 42 43 function filter_set_locale_to_polish() {43 public function filter_set_locale_to_polish() { 44 44 return 'pl_PL'; 45 45 } … … 48 48 * @ticket 52991 49 49 */ 50 function test_fields_are_extracted() {50 public function test_fields_are_extracted() { 51 51 $actual = WP_Theme_JSON_Resolver::get_fields_to_translate(); 52 52 … … 95 95 * @ticket 52991 96 96 */ 97 function test_translations_are_applied() {97 public function test_translations_are_applied() { 98 98 add_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 99 99 load_textdomain( 'fse', realpath( DIR_TESTDATA . '/languages/themes/fse-pl_PL.mo' ) ); … … 149 149 * @ticket 52991 150 150 */ 151 function test_switching_themes_recalculates_data() {151 public function test_switching_themes_recalculates_data() { 152 152 // By default, the theme for unit tests is "default", 153 153 // which doesn't have theme.json support.
Note: See TracChangeset
for help on using the changeset viewer.