Use @expectedDeprecated. see #25282, [25408].

git-svn-id: https://develop.svn.wordpress.org/trunk@25409 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-09-12 18:37:32 +00:00
parent d5d476974e
commit 4c8f1e263a
11 changed files with 93 additions and 61 deletions

View File

@@ -6,7 +6,6 @@
* @group themes
*/
class Tests_Theme extends WP_UnitTestCase {
protected $deprecated_functions = array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme' );
protected $theme_slug = 'twentyeleven';
protected $theme_name = 'Twenty Eleven';
@@ -34,6 +33,10 @@ class Tests_Theme extends WP_UnitTestCase {
$this->assertEquals( $themes[ $this->theme_slug ], $single_theme );
}
/**
* @expectedDeprecated get_theme
* @expectedDeprecated get_themes
*/
function test_get_themes_default() {
$themes = get_themes();
$this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_name ] );
@@ -44,6 +47,10 @@ class Tests_Theme extends WP_UnitTestCase {
$this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]->name );
}
/**
* @expectedDeprecated get_theme
* @expectedDeprecated get_themes
*/
function test_get_theme() {
$themes = get_themes();
foreach (array_keys($themes) as $name) {
@@ -67,6 +74,9 @@ class Tests_Theme extends WP_UnitTestCase {
}
}
/**
* @expectedDeprecated get_themes
*/
function test_get_themes_contents() {
$themes = get_themes();
// Generic tests that should hold true for any theme
@@ -153,6 +163,7 @@ class Tests_Theme extends WP_UnitTestCase {
/**
* @ticket 20897
* @expectedDeprecated get_theme_data
*/
function test_extra_theme_headers() {
$wp_theme = wp_get_theme( $this->theme_slug );
@@ -170,6 +181,10 @@ class Tests_Theme extends WP_UnitTestCase {
return array( 'License' );
}
/**
* @expectedDeprecated get_themes
* @expectedDeprecated get_current_theme
*/
function test_switch_theme() {
$themes = get_themes();