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_ThemeDir extends WP_UnitTestCase {
protected $deprecated_functions = array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme', 'get_broken_themes' );
function setUp() {
parent::setUp();
@@ -40,6 +39,10 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
return $this->theme_root;
}
/**
* @expectedDeprecated get_theme
* @expectedDeprecated get_themes
*/
function test_theme_default() {
$themes = get_themes();
$theme = get_theme('WordPress Default');
@@ -67,6 +70,10 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
$this->assertEquals( '', $theme['Parent Theme'] );
}
/**
* @expectedDeprecated get_theme
* @expectedDeprecated get_themes
*/
function test_theme_sandbox() {
$theme = get_theme('Sandbox');
@@ -98,7 +105,11 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
}
// a css only theme
/**
* A CSS-only theme
*
* @expectedDeprecated get_themes
*/
function test_theme_stylesheet_only() {
$themes = get_themes();
@@ -126,6 +137,9 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
}
/**
* @expectedDeprecated get_themes
*/
function test_theme_list() {
$themes = get_themes();
@@ -153,6 +167,10 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
$this->assertEquals($expected, $theme_names);
}
/**
* @expectedDeprecated get_themes
* @expectedDeprecated get_broken_themes
*/
function test_broken_themes() {
$themes = get_themes();
$expected = array('broken-theme' => array('Name' => 'broken-theme', 'Title' => 'broken-theme', 'Description' => __('Stylesheet is missing.')));
@@ -165,6 +183,9 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
$this->assertFalse( wp_get_theme( 'sandbox' )->errors() );
}
/**
* @expectedDeprecated get_themes
*/
function test_page_templates() {
$themes = get_themes();
@@ -175,6 +196,9 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
$this->assertTrue( in_array( $this->theme_root . '/page-templates/template-top-level.php', $templates));
}
/**
* @expectedDeprecated get_theme_data
*/
function test_get_theme_data_top_level() {
$theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' );
@@ -191,6 +215,9 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
$this->assertEquals( 'Minnie Bannister', $theme_data['AuthorName'] );
}
/**
* @expectedDeprecated get_theme_data
*/
function test_get_theme_data_subdir() {
$theme_data = get_theme_data( $this->theme_root . '/subdir/theme2/style.css' );