From 63cdf85fadf5713cc85d18f1f5f90160b7f9f508 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Wed, 18 May 2016 17:13:11 +0000 Subject: [PATCH] Correct usage of @Covers for Tests_Post_Types When @covers is used with a plain alphanumeric string, PHPUnit assumes that it is covering a class. If there is no class, it fails and exits rather than continuing to generate coverage. To cover a global function, the name must start with ::. See https://phpunit.de/manual/5.3/en/appendixes.annotations.html#appendixes.annotations.covers Introduced in [36768]. Fixes #36867. See #35985 git-svn-id: https://develop.svn.wordpress.org/trunk@37459 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/types.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php index f216ec5680..d203b740be 100644 --- a/tests/phpunit/tests/post/types.php +++ b/tests/phpunit/tests/post/types.php @@ -61,7 +61,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_exclude_from_search_should_default_to_opposite_value_of_public() { /* @@ -75,7 +75,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_publicly_queryable_should_default_to_value_of_public() { /* @@ -89,7 +89,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_show_ui_should_default_to_value_of_public() { /* @@ -103,7 +103,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_show_in_menu_should_default_to_value_of_show_ui() { /* @@ -122,7 +122,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_show_in_nav_menus_should_default_to_value_of_public() { /* @@ -136,7 +136,7 @@ class Tests_Post_Types extends WP_UnitTestCase { /** * @ticket 35985 - * @covers register_post_type() + * @covers ::register_post_type() */ function test_register_post_type_show_in_admin_bar_should_default_to_value_of_show_in_menu() { /*