Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing @covers annotations #1255

Open
wants to merge 217 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
f40ddb9
Merge pull request #1 from WordPress/master
pbearne Apr 30, 2021
ba2ac01
Actions folder
pbearne May 3, 2021
ca5870b
Root tests
pbearne May 3, 2021
ee096ea
Fixed Root tests
pbearne May 4, 2021
78c9b6c
Fixed Root tests part 2
pbearne May 4, 2021
6239347
Fixed Root tests part 2
pbearne May 4, 2021
0421500
The A folders
pbearne May 5, 2021
78ad603
The Block folder
pbearne May 7, 2021
073932b
The bookmark folder
pbearne May 7, 2021
1c5378a
Remove not needed/user return var
pbearne May 13, 2021
87b7866
Fixed setup/tearDown
pbearne May 13, 2021
5cc4239
Merge pull request #2 from WordPress/master
pbearne May 13, 2021
435635b
the C folders
pbearne May 13, 2021
8abbb86
Merge branch 'master' into #39265_covers
pbearne May 13, 2021
68f9301
Work todate
pbearne May 13, 2021
dc90879
Whitespaces and bad test fixed
pbearne May 14, 2021
c15f8c5
renamed @cover ::autop to ::wpautop
pbearne May 17, 2021
2428c8c
removed @cover per function to use the global
pbearne May 17, 2021
5306303
removed @cover per function to use the global
pbearne May 17, 2021
7936b9d
removed @cover per function to use the global
pbearne May 17, 2021
7a1f7fd
checked F folders
pbearne May 18, 2021
915466e
checked g folder
pbearne May 18, 2021
bb95cd1
checked h folder
pbearne May 25, 2021
0fb9eed
checked i folders
pbearne May 25, 2021
20180ae
checked L folders
pbearne May 26, 2021
d898d30
Merge branch 'WordPress:master' into master
pbearne May 26, 2021
540d88d
Merge branch 'master' into #39265_covers
pbearne May 26, 2021
1e44231
checked L folders
pbearne May 26, 2021
49c2c10
Merge branch 'WordPress:master' into master
pbearne May 27, 2021
cb363f2
Merge branch 'master' into #39265_covers
pbearne May 27, 2021
266804a
checked M folders
pbearne May 27, 2021
175157c
checked O folders
pbearne May 27, 2021
2bd155c
checked P folders
pbearne May 28, 2021
db01665
checked Q folders
pbearne May 28, 2021
6b0b543
reverted IDE striped tab
pbearne May 28, 2021
4ec0121
checked S and T folders
pbearne May 28, 2021
5d6c9b8
Move test from editPost.php
pbearne May 31, 2021
59b9633
the last files
pbearne May 31, 2021
e204e86
Merge branch 'WordPress:master' into master
pbearne May 31, 2021
e85e65d
Merge branch 'master' into #39265_covers
pbearne May 31, 2021
b0e496a
Add covers to REST API endpoints
spacedmonkey Jun 1, 2021
7cec00f
reverted changes to Grunfile.js and package.json
pbearne Jun 1, 2021
30443b3
Merge branch 'WordPress:master' into master
pbearne Jun 1, 2021
2c98d29
Merge branch 'master' into #39265_covers
pbearne Jun 1, 2021
36bd553
Merge pull request #3 from spacedmonkey/fix/covers
pbearne Jun 1, 2021
52ef075
reverted changes to themeDir.php
pbearne Jun 1, 2021
9cf6bf2
Merge branch 'WordPress:master' into #39265_covers
pbearne Jun 4, 2021
aca1d43
sett forceCoversAnnotation to true
pbearne Jun 4, 2021
82ad7f5
Merge branch 'WordPress:master' into master
pbearne Jun 10, 2021
11173b2
Merge branch 'WordPress:master' into #39265_covers
pbearne Jun 10, 2021
24188e2
added missing covers
pbearne Jun 11, 2021
2076f7d
Merge pull request #4 from WordPress/master
pbearne Jun 11, 2021
41d9a08
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
d69a6e1
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
94c1de1
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
6ab813e
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
af83e3f
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
0aa6476
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
e225840
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
c40815f
Update tests/phpunit/tests/actions.php
pbearne Jun 14, 2021
7dd2f81
Merge branch 'WordPress:master' into master
pbearne Jun 14, 2021
4fb0e92
Merge branch 'master' into #39265_covers
pbearne Jun 14, 2021
511f6b0
Update tests/phpunit/tests/actions/callbacks.php
pbearne Jun 15, 2021
de2fc78
Update tests/phpunit/tests/actions/closures.php
pbearne Jun 15, 2021
7f1406d
Merge branch 'master' into #39265_covers
pbearne Jun 15, 2021
afb548b
There were 39 warnings:
pbearne Jun 16, 2021
8d277a5
Merge remote-tracking branch 'origin/#39265_covers' into #39265_covers
pbearne Jun 16, 2021
1bcf976
1) Tests_Admin_includesMisc::test_shorten_url
pbearne Jun 16, 2021
4d1dd75
replace space with tabs for cs2pr tests
pbearne Jun 16, 2021
580151e
Update tests/phpunit/tests/admin/includesCommunityEvents.php
pbearne Jun 17, 2021
8604f63
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
24482ba
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
bb1a867
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
a7fcd54
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
dc58fdf
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
c46a3a6
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
9b681f7
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
11c793d
Update tests/phpunit/tests/admin/includesListTable.php
pbearne Jun 17, 2021
aea0010
fixed covers as per hellofromtonya change
pbearne Jun 17, 2021
412303c
Merge branch 'WordPress:master' into #39265_covers
pbearne Jun 17, 2021
34d05b0
Update tests/phpunit/tests/admin/includesPlugin.php
pbearne Jun 17, 2021
0153555
Update tests/phpunit/tests/admin/includesPlugin.php
pbearne Jun 17, 2021
8c0071b
Update tests/phpunit/tests/admin/includesSchema.php
pbearne Jun 17, 2021
5f34a4b
Update tests/phpunit/tests/admin/includesScreen.php
pbearne Jun 17, 2021
2ffd177
Update tests/phpunit/tests/admin/includesPost.php
pbearne Jun 17, 2021
c637fb0
fixed white space
pbearne Jun 18, 2021
90a5508
Merge branch 'WordPress:master' into #39265_covers
pbearne Jun 21, 2021
f9ecb9c
Update tests/phpunit/tests/admin/includesScreen.php
pbearne Jun 21, 2021
b666263
Update tests/phpunit/tests/admin/includesScreen.php
pbearne Jun 21, 2021
bf2eafd
fixed test_is_block_editor comment
pbearne Jun 21, 2021
0e9c7e2
Update tests/phpunit/tests/rest-api/rest-block-type-controller.php
pbearne Jun 21, 2021
dae10d3
Merge branch 'WordPress:master' into master
pbearne Jun 22, 2021
0eb3b82
Merge branch 'WordPress:master' into #39265_covers
pbearne Jun 22, 2021
6284a16
Merge branch 'WordPress:master' into master
pbearne Jul 12, 2021
76acf72
Merge branch 'master' into #39265_covers
pbearne Jul 12, 2021
507c3d4
Merge branch 'master' into #39265_covers
pbearne Oct 5, 2021
a1ff96e
Merge branch 'master' into #39265_covers
pbearne Oct 5, 2021
b6c6497
Merge branch 'trunk' into #39265_covers
pbearne Nov 26, 2021
d1f95db
Merge pull request #10 from WordPress/trunk
pbearne Nov 26, 2021
83d8539
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Jan 5, 2022
18660fe
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Jan 11, 2022
53ee075
Merge branch 'trunk' into #39265_covers
pbearne Jan 18, 2022
6324271
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Jan 19, 2022
2f6ec26
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Jan 28, 2022
bebd622
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Feb 11, 2022
09aa27d
Merge branch 'trunk' into #39265_covers
pbearne Feb 25, 2022
213cf4a
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Mar 1, 2022
93de420
Merge branch 'trunk' into #39265_covers
pbearne Mar 14, 2022
5a3260b
Merge remote-tracking branch 'origin/#39265_covers' into #39265_covers
pbearne Mar 14, 2022
85bbfba
Change test class name to better match intent
ironprogrammer Mar 18, 2022
b178f0c
Replace with `@coversNothing`
ironprogrammer Mar 18, 2022
051dd82
Rename and move file to match path in source
ironprogrammer Mar 18, 2022
60dae20
Add description to test class
ironprogrammer Mar 18, 2022
69d9cf5
Remove redundant function signature
ironprogrammer Mar 18, 2022
0c8ce46
Fix function declarations
ironprogrammer Mar 18, 2022
7526ecd
Migrate setUp/tearDown functions
ironprogrammer Mar 18, 2022
6c12419
Update covers for cron tests
ironprogrammer Mar 22, 2022
e16e535
Merge branch 'trunk' into #39265_covers
pbearne Mar 23, 2022
c1e7512
Merge branch 'trunk' into #39265_covers
pbearne Mar 30, 2022
920a2d4
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Mar 31, 2022
93845bf
Merge branch 'trunk' into #39265_covers
pbearne Apr 13, 2022
ac42fad
Update @covers tag for Tests_Ajax_AddMeta class
anton-vlasenko May 26, 2022
068fecc
Add @covers tag for Tests_Ajax_AddTag class.
anton-vlasenko May 27, 2022
950e4d8
Add @covers tag for Tests_Ajax_Attachments class.
anton-vlasenko May 30, 2022
28dc641
Fixed @covers tag for Tests_Ajax_CompressionTest::test_logged_out.
anton-vlasenko May 30, 2022
15e1231
Add @covers tag for Tests_Ajax_CustomizeMenus class.
anton-vlasenko Jun 8, 2022
ab7d364
Add @covers tag for Tests_Ajax_DeleteComment class.
anton-vlasenko Jun 8, 2022
a8b0881
Add @covers tag for Tests_Ajax_Delete_Plugin::test_delete_plugin class.
anton-vlasenko Jun 8, 2022
65b5cbe
Fix @covers tag for Tests_Ajax_Manage_Themes class.
anton-vlasenko Jun 8, 2022
1c077d5
Refactor Tests_Attachment_Slashes class.
anton-vlasenko Jun 9, 2022
674f71f
Refactor Test_Block_Supports_Border class.
anton-vlasenko Jun 9, 2022
be107c2
Add additional @covers tags for Tests_L10n_LoadTextdomain class.
anton-vlasenko Jun 10, 2022
903bb53
Remove unused variable in the Tests_Multisite_Option::test_users_can_…
anton-vlasenko Jun 10, 2022
06b6bc6
Add additional @covers tags for Tests_Url_GetPrivacyPolicyUrl class.
anton-vlasenko Jun 10, 2022
73bdcee
Add additional @covers tags for Tests_URL class.
anton-vlasenko Jun 10, 2022
940706a
Checkout file from trunk
ironprogrammer Jun 17, 2022
6fdf130
Add `@covers` to Tests_Formatting_ConvertInvalidEntities
ironprogrammer Jun 17, 2022
b577ee0
Rename file corrects `Entries` -> `Entities`
ironprogrammer Jun 17, 2022
8f579d8
Update `@covers` for Tests_Formatting_EscUrl
ironprogrammer Jun 17, 2022
a0aa059
Remove class-level `@covers`
ironprogrammer Jun 22, 2022
290cef4
Add test `@covers` in Tests_Formatting_GetBloginfo
ironprogrammer Jun 22, 2022
abd1a15
Remove redundant `@covers` in Tests_Formatting_SanitizeOrderby
ironprogrammer Jun 22, 2022
8659721
Remove redundant `@covers` from DocBlock
ironprogrammer Jun 22, 2022
3b1a4f2
Shift `@ticket` notation to more consistent order
ironprogrammer Jun 22, 2022
571d0e4
Consolidate `@covers` to class-level
ironprogrammer Jun 22, 2022
2982660
Add missing `@covers` for KSES tests
ironprogrammer Jun 23, 2022
a4b32f8
Correct `@covers` reference to tested function
ironprogrammer Jun 23, 2022
c6de91e
Merge branch 'trunk' into #39265_covers
pbearne Jun 23, 2022
e8dd095
Add @covers tags for Tests_Block_Template_Utils class.
anton-vlasenko Jun 24, 2022
06e4718
Remove redundant @covers tags from Tests_Bookmark_GetBookmark class.
anton-vlasenko Jun 28, 2022
467798b
Revert "Remove redundant @covers tags from Tests_Bookmark_GetBookmark…
anton-vlasenko Jun 28, 2022
fcacd68
Fix code review feedback.
anton-vlasenko Jun 28, 2022
0137055
Remove redundant @covers tags from Tests_Canonical_HTTPS class.
anton-vlasenko Jun 28, 2022
c9f1ebe
Add missing @covers tags for Tests_Canonical class.
anton-vlasenko Jun 28, 2022
b051637
Add missing @covers tags for Tests_Comment class.
anton-vlasenko Jun 29, 2022
0caca35
Fix @covers tags in Tests_DB_Charset and Tests_Cache.
anton-vlasenko Jul 5, 2022
5892082
Remove redundant @covers annotations in Tests_Editor_wpEditors class.
anton-vlasenko Jul 6, 2022
bbbaab4
Add @covers tag in Tests_Feed_Atom class.
anton-vlasenko Jul 7, 2022
a6093f4
Fix @covers tag in Tests_Feed_RSS2 class.
anton-vlasenko Jul 7, 2022
e35268e
Fix @covers tag in Tests_Error_Protection_wpRecoveryModeCookieService…
anton-vlasenko Jul 7, 2022
78ccd56
Fix @covers tag in TestFactoryFor and Tests_TestHelpers class.
anton-vlasenko Jul 7, 2022
515feba
Merge branch 'trunk' into #39265_covers
pbearne Jul 7, 2022
2520583
Fix @covers tag in Tests_Dependencies class.
anton-vlasenko Jul 7, 2022
ec99998
Fix @covers tag in Tests_Import_Import class.
anton-vlasenko Jul 7, 2022
ccc18c7
Fix @covers tag in Tests_Import_Postmeta class.
anton-vlasenko Jul 7, 2022
5920cf0
Fix code review feedback. More info here: https://github.com/pbearne/…
anton-vlasenko Jul 8, 2022
39729bc
Remove duplicate @covers tags from Tests_Url_GetPrivacyPolicyUrl class.
anton-vlasenko Jul 8, 2022
dc5c103
Fix missing @covers tags in Tests_File class.
anton-vlasenko Jul 8, 2022
f4ba5da
Fix @covers tags in Tests_Dependencies_jQuery.
anton-vlasenko Jul 12, 2022
b68162e
Fix @covers tags in Test_WP_Customize_Control class.
anton-vlasenko Jul 15, 2022
21f64a2
Remove redundant @covers tags in Tests_Date_CurrentTime.
anton-vlasenko Jul 22, 2022
e85220c
Fix @covers tags in Tests_Functions.
anton-vlasenko Jul 22, 2022
b61438f
In my opinion code coverage report should only cover actual WordPress…
anton-vlasenko Jul 27, 2022
7f96333
Fix code review feedback. Please see https://github.com/pbearne/wordp…
anton-vlasenko Jul 27, 2022
82e82b7
Fix code review feedback. Please see https://github.com/pbearne/wordp…
anton-vlasenko Jul 27, 2022
dd9d628
Fix code review feedback. https://github.com/pbearne/wordpress-develo…
anton-vlasenko Jul 27, 2022
24165a8
Fix code review feedback. Please see https://github.com/pbearne/wordp…
anton-vlasenko Jul 27, 2022
b9674b5
Fix code review feedback. Please see https://github.com/pbearne/wordp…
anton-vlasenko Jul 27, 2022
1e8bcf0
Fix code review feedback. See https://github.com/pbearne/wordpress-de…
anton-vlasenko Jul 27, 2022
3d0b6a6
Add missing @covers tags in Tests_Shortcode.
anton-vlasenko Jul 29, 2022
d9ff767
Fix @covers tags in TestFactoryFor and Tests_TestHelpers.
anton-vlasenko Aug 10, 2022
a252b0e
Merge branch 'trunk' into #39265_covers
pbearne Sep 29, 2022
adda9f4
Update template.php
pbearne Sep 29, 2022
177a478
fixed test
pbearne Sep 29, 2022
09e65cc
Merge remote-tracking branch 'origin/#39265_covers' into #39265_covers
pbearne Sep 29, 2022
8536914
fixed whitespace
pbearne Sep 29, 2022
0b5c4d6
Restore covers on Tests_Dependencies_jQuery::test_wp_script_is_dep_en…
hellofromtonya Mar 16, 2023
11c74df
Merge branch 'trunk' into #39265_covers
pbearne Sep 26, 2023
40fd989
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Sep 26, 2023
dac610b
fixed bad merge
pbearne Sep 26, 2023
8291825
Merge remote-tracking branch 'origin/#39265_covers' into #39265_covers
pbearne Sep 26, 2023
06393f7
fixed bad merge
pbearne Sep 26, 2023
e5506b0
fixed bad merge
pbearne Sep 27, 2023
b1a410a
fixed bad merge
pbearne Sep 27, 2023
2f38c0b
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Sep 27, 2023
b427c54
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Sep 28, 2023
aca9c57
Merge branch 'trunk' into #39265_covers
pbearne Oct 3, 2023
6d49dbf
Merge branch 'WordPress:trunk' into #39265_covers
pbearne Oct 9, 2023
65af813
end of day save
pbearne Nov 9, 2021
0ccfcbc
added update code
pbearne Nov 9, 2021
d171028
work so far
pbearne Jan 13, 2022
55268e3
work so far
pbearne Jan 13, 2022
02ada5d
work so far
pbearne Jan 14, 2022
5e9d490
work so far
pbearne Jan 14, 2022
f978dbd
seems to be working
pbearne Jan 17, 2022
d12536c
seems to be working
pbearne Jan 17, 2022
f0d708c
stashing
pbearne Jul 12, 2022
dc9ce74
got it work
pbearne Jul 20, 2022
61e61dd
added test for cache
pbearne Aug 3, 2022
890cc9d
added test for cache
pbearne Aug 3, 2022
9c8894f
FIxed the conect not returning the same key for first and later calls
pbearne Sep 5, 2022
b78acbd
whitespace
pbearne Sep 9, 2022
e561b39
fixed bad merge
pbearne Sep 28, 2023
1e09362
fixed bad merge
pbearne Oct 11, 2023
bb3dbc3
Merge branch 'trunk' into #39265_covers
pbearne Oct 13, 2023
4f15139
Merge branch 'trunk' into #39265_covers
pbearne Oct 13, 2023
bcd560c
Merge branch 'trunk' into #39265_covers
pbearne Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
backupGlobals="false"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
forceCoversAnnotation="true"
>
<testsuites>
<!-- Default test suite to run all tests. -->
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/multisite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
backupGlobals="false"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
forceCoversAnnotation="true"
>
<php>
<const name="WP_TESTS_MULTISITE" value="1" />
Expand Down
72 changes: 71 additions & 1 deletion tests/phpunit/tests/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
class Tests_Actions extends WP_UnitTestCase {

/**
* @covers ::do_action
*/
function test_simple_action() {
$a = new MockAction();
$tag = __FUNCTION__;
Expand All @@ -24,6 +27,9 @@ function test_simple_action() {
$this->assertSame( array( '' ), $args );
}

/**
* @covers ::remove_action
*/
function test_remove_action() {
$a = new MockAction();
$tag = __FUNCTION__;
Expand All @@ -43,6 +49,9 @@ function test_remove_action() {

}

/**
* @covers ::has_action
*/
function test_has_action() {
$tag = __FUNCTION__;
$func = __FUNCTION__ . '_func';
Expand All @@ -57,7 +66,11 @@ function test_has_action() {
$this->assertFalse( has_action( $tag ) );
}

// One tag with multiple actions.
/**
* One tag with multiple actions.
*
* @covers ::do_action
*/
function test_multiple_actions() {
$a1 = new MockAction();
$a2 = new MockAction();
Expand All @@ -74,6 +87,11 @@ function test_multiple_actions() {
$this->assertSame( 1, $a2->get_call_count() );
}

/**
* One tag with multiple actions.
*
* @covers ::do_action
*/
function test_action_args_1() {
$a = new MockAction();
$tag = __FUNCTION__;
Expand All @@ -89,6 +107,11 @@ function test_action_args_1() {
$this->assertSame( array( $val ), array_pop( $argsvar ) );
}

/**
* One tag with multiple actions.
*
* @covers ::do_action
*/
function test_action_args_2() {
$a1 = new MockAction();
$a2 = new MockAction();
Expand Down Expand Up @@ -120,6 +143,8 @@ function test_action_args_2() {
*
* @see https://core.trac.wordpress.org/ticket/17817#comment:72
* @ticket 17817
*
* @covers ::do_action
*/
function test_action_args_3() {
$a1 = new MockAction();
Expand Down Expand Up @@ -157,6 +182,8 @@ function test_action_args_3() {
* Tests PHP 4 notation for calling actions while passing in an object by reference.
*
* @ticket 48312
*
* @covers ::do_action
*/
function test_action_args_with_php4_syntax() {
$a = new MockAction();
Expand Down Expand Up @@ -201,6 +228,9 @@ function test_action_priority() {
$this->assertSame( $expected, $a->get_events() );
}

/**
* @covers ::did_action
*/
function test_did_action() {
$tag1 = 'action1';
$tag2 = 'action2';
Expand All @@ -222,6 +252,9 @@ function test_did_action() {

}

/**
* @covers ::do_action
*/
function test_all_action() {
$a = new MockAction();
$tag1 = __FUNCTION__ . '_1';
Expand All @@ -246,6 +279,9 @@ function test_all_action() {

}

/**
* @covers ::remove_action
*/
function test_remove_all_action() {
$a = new MockAction();
$tag = __FUNCTION__;
Expand All @@ -266,6 +302,9 @@ function test_remove_all_action() {
$this->assertSame( array( $tag ), $a->get_tags() );
}

/**
* @covers ::do_action_ref_array
*/
function test_action_ref_array() {
$obj = new stdClass();
$a = new MockAction();
Expand All @@ -284,6 +323,8 @@ function test_action_ref_array() {

/**
* @ticket 11241
*
* @covers ::do_action
*/
function test_action_keyed_array() {
$a = new MockAction();
Expand All @@ -309,6 +350,9 @@ function test_action_keyed_array() {

}

/**
* @covers ::remove_action
*/
function test_action_self_removal() {
add_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
do_action( 'test_action_self_removal' );
Expand All @@ -321,6 +365,8 @@ function action_self_removal() {

/**
* @ticket 17817
*
* @covers ::do_action
*/
function test_action_recursion() {
$tag = __FUNCTION__;
Expand All @@ -336,6 +382,9 @@ function test_action_recursion() {
$this->assertSame( 2, $b->get_call_count(), 'recursive actions should call callbacks with later priority' );
}

/**
* @covers ::do_action
*/
function action_that_causes_recursion( $tag ) {
static $recursing = false;
if ( ! $recursing ) {
Expand All @@ -348,6 +397,9 @@ function action_that_causes_recursion( $tag ) {
/**
* @ticket 9968
* @ticket 17817
*
* @covers ::remove_action
* @covers ::add_action
pbearne marked this conversation as resolved.
Show resolved Hide resolved
*/
function test_action_callback_manipulation_while_running() {
$tag = __FUNCTION__;
Expand Down Expand Up @@ -383,6 +435,8 @@ function action_that_manipulates_a_running_hook( $tag, $mocks ) {
*
* This specificaly addresses the concern raised at
* https://core.trac.wordpress.org/ticket/17817#comment:52
*
* @covers ::remove_filter
*/
function test_remove_anonymous_callback() {
$tag = __FUNCTION__;
Expand Down Expand Up @@ -416,6 +470,10 @@ function test_remove_anonymous_callback() {
* Test the ArrayAccess methods of WP_Hook
*
* @ticket 17817
*
* @covers WP_Hook::offsetGet
* @covers WP_Hook::offsetSet
* @covers WP_Hook::offsetUnset
*/
function test_array_access_of_wp_filter_global() {
global $wp_filter;
Expand All @@ -442,6 +500,8 @@ function test_array_access_of_wp_filter_global() {
* Make sure current_action() behaves as current_filter()
*
* @ticket 14994
*
* @covers ::current_action
*/
function test_current_action() {
global $wp_current_filter;
Expand All @@ -453,6 +513,8 @@ function test_current_action() {

/**
* @ticket 14994
*
* @covers ::doing_filter
*/
function test_doing_filter() {
global $wp_current_filter;
Expand All @@ -472,6 +534,8 @@ function test_doing_filter() {

/**
* @ticket 14994
*
* @covers ::doing_filter
*/
function test_doing_action() {
global $wp_current_filter;
Expand All @@ -491,6 +555,8 @@ function test_doing_action() {

/**
* @ticket 14994
*
* @covers ::doing_filter
*/
function test_doing_filter_real() {
$this->assertFalse( doing_filter() ); // No filter is passed in, and no filter is being processed.
Expand Down Expand Up @@ -541,6 +607,8 @@ function apply_testing_nested_filter() {
/**
* @ticket 10441
* @expectedDeprecated tests_do_action_deprecated
*
* @covers ::do_action_deprecated
*/
public function test_do_action_deprecated() {
$p = new WP_Post( (object) array( 'post_title' => 'Foo' ) );
Expand All @@ -559,6 +627,8 @@ public static function deprecated_action_callback( $p ) {
/**
* @ticket 10441
* @expectedDeprecated tests_do_action_deprecated
*
* @covers ::do_action_deprecated
*/
public function test_do_action_deprecated_with_multiple_params() {
$p1 = new WP_Post( (object) array( 'post_title' => 'Foo1' ) );
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/tests/actions/callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Tests_Actions_Callbacks extends WP_UnitTestCase {

/**
* @ticket 23265
*
* @covers ::add_action
*/
function test_callback_representations() {
$tag = __FUNCTION__;
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/tests/actions/closures.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class Tests_Actions_Closures extends WP_UnitTestCase {

/**
* @ticket 10493
*
* @covers ::add_action
* @covers ::has_action
* @covers ::do_action
pbearne marked this conversation as resolved.
Show resolved Hide resolved
*/
function test_action_closure() {
$tag = 'test_action_closure';
Expand Down
10 changes: 10 additions & 0 deletions tests/phpunit/tests/admin/includesComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {

/**
* Verify that both the comment date and author must match for a comment to exist.
*
* @covers ::comment_exists
*/
public function test_must_match_date_and_author() {
$this->assertNull( comment_exists( 1, '2004-01-02 12:00:00' ) );
Expand All @@ -55,27 +57,35 @@ public function test_must_match_date_and_author() {

/**
* @ticket 33871
*
* @covers ::comment_exists
*/
public function test_default_value_of_timezone_should_be_blog() {
$this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00' ) );
}

/**
* @ticket 33871
*
* @covers ::comment_exists
*/
public function test_should_respect_timezone_blog() {
$this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00', 'blog' ) );
}

/**
* @ticket 33871
*
* @covers ::comment_exists
*/
public function test_should_respect_timezone_gmt() {
$this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 07:00:00', 'gmt' ) );
}

/**
* @ticket 33871
*
* @covers ::comment_exists
*/
public function test_invalid_timezone_should_fall_back_on_blog() {
$this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00', 'not_a_valid_value' ) );
Expand Down
Loading