Changeset 570 in tests
- Timestamp:
- 03/13/2012 09:51:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_includes_theme.php
r497 r570 11 11 function test_get_themes_default() { 12 12 $themes = get_themes(); 13 // one theme is included by default: Twenty Ten14 $this->assert True( is_array($themes['Twenty Ten']));13 // one theme is included by default: Twenty Eleven 14 $this->assertInstanceOf( 'WP_Theme', $themes['Twenty Eleven']); 15 15 } 16 16 17 17 function test_get_themes_contents() { 18 $themes = get_themes();18 $themes = wp_get_themes(); 19 19 20 20 // Generic tests that should hold true for any theme 21 21 foreach ($themes as $k=>$theme) { 22 $this->assertEquals($theme[' Name'], $k);22 $this->assertEquals($theme['Template'], $k); 23 23 $this->assertTrue(!empty($theme['Title'])); 24 24 … … 73 73 $this->assertTrue(is_dir($dir . $theme['Stylesheet Dir'])); 74 74 75 $this->assertEquals('publi sh', $theme['Status']);75 $this->assertEquals('public', $theme['Status']); 76 76 77 77 $this->assertTrue(is_file($dir . $theme['Stylesheet Dir'] . '/' . $theme['Screenshot'])); … … 81 81 82 82 function test_get_theme() { 83 $themes = get_themes(); 84 85 foreach (array_keys($themes) as $name) { 86 $theme = get_theme($name); 87 $this->assertTrue(is_array($theme)); 88 $this->assertEquals($theme, $themes[$name]); 83 $themes = wp_get_themes(); 84 foreach ( $themes as $theme ) { 85 $_theme = wp_get_theme( $theme->get_stylesheet() ); 86 $this->assertInstanceOf( 'WP_Theme', $_theme ); 87 $this->assertFalse( $_theme->errors() ); 89 88 } 90 89 } … … 166 165 update_option('stylesheet', $style); 167 166 168 $this->assertEquals( 'Twenty Ten', get_current_theme() ); 167 $theme = wp_get_theme(); 168 $this->assertEquals( $style, $theme->__toString() ); 169 $this->assertTrue( false !== $theme->errors() ); 169 170 170 171 // these return the bogus name - perhaps not ideal behaviour?
Note: See TracChangeset
for help on using the changeset viewer.