Changeset 51287 for trunk/tests/phpunit/tests/theme/wpTheme.php
- Timestamp:
- 06/30/2021 06:21:52 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpTheme.php
r50967 r51287 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
Note: See TracChangeset
for help on using the changeset viewer.