Changeset 53253
- Timestamp:
- 04/25/2022 09:45:00 AM (14 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r53190 r53253 1211 1211 } 1212 1212 1213 return $files;1213 return array_filter( $files ); 1214 1214 } 1215 1215 -
trunk/tests/phpunit/tests/theme/wpTheme.php
r52391 r53253 263 263 264 264 /** 265 * Test get_files for an existing theme. 266 * 267 * @ticket 53599 268 */ 269 public function test_get_files_theme() { 270 $theme = new WP_Theme( 'theme1', $this->theme_root ); 271 $files = $theme->get_files(); 272 273 $this->assertIsArray( $files ); 274 $this->assertCount( 3, $files ); 275 $this->assertArrayHasKey( 'functions.php', $files ); 276 $this->assertArrayHasKey( 'index.php', $files ); 277 $this->assertArrayHasKey( 'style.css', $files ); 278 } 279 280 /** 281 * Test get_files for a non-existing theme. 282 * 283 * @ticket 53599 284 */ 285 public function test_get_files_nonexistent_theme() { 286 $theme = new WP_Theme( 'nonexistent', $this->theme_root ); 287 $files = $theme->get_files(); 288 289 $this->assertIsArray( $files ); 290 $this->assertEmpty( $files ); 291 } 292 293 /** 265 294 * Data provider. 266 295 *
Note: See TracChangeset
for help on using the changeset viewer.