From 4f6eee8e72e0ed130a91d2f9b5d1b906f2a33e32 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 28 Oct 2020 15:12:40 +0000 Subject: [PATCH] Themes: Move the test for `post-formats` theme support to a more appropriate place. Follow-up to [49344]. See #51390. git-svn-id: https://develop.svn.wordpress.org/trunk@49354 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme.php | 2 +- tests/phpunit/tests/post/formats.php | 10 ---------- tests/phpunit/tests/theme/support.php | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 237a4d3e14..7faf3844e8 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -2481,7 +2481,7 @@ function get_theme_starter_content() { * by adding it to the function signature. * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default. * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'. - * @since 5.6.0 The `post-formats` feature now returns doing it wrong if no array is passed + * @since 5.6.0 The `post-formats` feature warns if no array is passed. * * @global array $_wp_theme_features * diff --git a/tests/phpunit/tests/post/formats.php b/tests/phpunit/tests/post/formats.php index 7c49fb03b5..44cedfc9a6 100644 --- a/tests/phpunit/tests/post/formats.php +++ b/tests/phpunit/tests/post/formats.php @@ -8,16 +8,6 @@ class Tests_Post_Formats extends WP_UnitTestCase { parent::setUp(); } - /** - * @ticket 51390 - */ - function test_post_format_doing_it_wrong() { - $this->setExpectedIncorrectUsage( "add_theme_support( 'post-formats' )" ); - - // The second parameter should be an array. - $this->assertFalse( add_theme_support( 'post-formats' ) ); - } - function test_set_get_post_format_for_post() { $post_id = self::factory()->post->create(); diff --git a/tests/phpunit/tests/theme/support.php b/tests/phpunit/tests/theme/support.php index 25100c46ac..e258f87281 100644 --- a/tests/phpunit/tests/theme/support.php +++ b/tests/phpunit/tests/theme/support.php @@ -132,6 +132,16 @@ class Tests_Theme_Support extends WP_UnitTestCase { $this->assertFalse( current_theme_supports( 'html5' ) ); } + /** + * @ticket 51390 + * + * @expectedIncorrectUsage add_theme_support( 'post-formats' ) + */ + function test_supports_post_formats_doing_it_wrong() { + // The second parameter should be an array. + $this->assertFalse( add_theme_support( 'post-formats' ) ); + } + function supports_foobar( $yesno, $args, $feature ) { if ( $args[0] === $feature[0] ) { return true;