Skip to content

Commit bf193c6

Browse files
committed
Add covers comments
1 parent dc03929 commit bf193c6

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

tests/RandomPostOnRefreshTest.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
class RandomPostOnRefreshTest extends TestCase {
1414
/**
1515
* Test that parse_id_list returns an array of integers from a string.
16+
*
17+
* @covers RandomPostOnRefresh::parse_id_list
1618
*/
1719
public function test_parse_id_list_returns_array_of_ints() {
1820
$result = RandomPostOnRefresh::parse_id_list( '1,2,3,abc,4' );
@@ -21,6 +23,8 @@ public function test_parse_id_list_returns_array_of_ints() {
2123

2224
/**
2325
* Test that parse_id_list returns an empty array for an empty string.
26+
*
27+
* @covers RandomPostOnRefresh::parse_id_list
2428
*/
2529
public function test_parse_id_list_empty_string_returns_empty_array() {
2630
$result = RandomPostOnRefresh::parse_id_list( '' );
@@ -29,6 +33,8 @@ public function test_parse_id_list_empty_string_returns_empty_array() {
2933

3034
/**
3135
* Test that list_to_array splits and trims a comma-separated string.
36+
*
37+
* @covers RandomPostOnRefresh::list_to_array
3238
*/
3339
public function test_list_to_array_splits_and_trims() {
3440
$result = RandomPostOnRefresh::list_to_array( ' a ,b, c ' );
@@ -37,6 +43,8 @@ public function test_list_to_array_splits_and_trims() {
3743

3844
/**
3945
* Test that list_to_array works with a custom delimiter.
46+
*
47+
* @covers RandomPostOnRefresh::list_to_array
4048
*/
4149
public function test_list_to_array_with_custom_delimiter() {
4250
$result = RandomPostOnRefresh::list_to_array( 'a|b|c', '|' );
@@ -45,6 +53,12 @@ public function test_list_to_array_with_custom_delimiter() {
4553

4654
/**
4755
* Smoke test: shortcode handler should return a string.
56+
*
57+
* @covers RandomPostOnRefresh::shortcode
58+
* @covers RandomPostOnRefresh::build_query_args
59+
* @covers RandomPostOnRefresh::parse_id_list
60+
* @covers RandomPostOnRefresh::list_to_array
61+
* @covers RandomPostOnRefresh::error
4862
*/
4963
public function test_shortcode_returns_string() {
5064
$output = RandomPostOnRefresh::shortcode( array() );
@@ -53,6 +67,9 @@ public function test_shortcode_returns_string() {
5367

5468
/**
5569
* Test build_query_args with default attributes.
70+
*
71+
* @covers RandomPostOnRefresh::build_query_args
72+
* @covers RandomPostOnRefresh::list_to_array
5673
*/
5774
public function test_build_query_args_defaults() {
5875
$args = RandomPostOnRefresh::build_query_args( RandomPostOnRefresh::DEFAULT_ATTRIBUTES );
@@ -84,6 +101,9 @@ public function test_build_query_args_defaults() {
84101

85102
/**
86103
* Test build_query_args with minimal attributes.
104+
*
105+
* @covers RandomPostOnRefresh::build_query_args
106+
* @covers RandomPostOnRefresh::list_to_array
87107
*/
88108
public function test_build_query_args_minimal() {
89109
$atts = array_merge(
@@ -100,6 +120,10 @@ public function test_build_query_args_minimal() {
100120

101121
/**
102122
* Test build_query_args with author, ids, not, and search.
123+
*
124+
* @covers RandomPostOnRefresh::build_query_args
125+
* @covers RandomPostOnRefresh::list_to_array
126+
* @covers RandomPostOnRefresh::parse_id_list
103127
*/
104128
public function test_build_query_args_with_filters() {
105129
$atts = array_merge(
@@ -121,6 +145,10 @@ public function test_build_query_args_with_filters() {
121145

122146
/**
123147
* Test build_query_args with taxonomy and terms.
148+
*
149+
* @covers RandomPostOnRefresh::build_query_args
150+
* @covers RandomPostOnRefresh::list_to_array
151+
* @covers RandomPostOnRefresh::parse_id_list
124152
*/
125153
public function test_build_query_args_with_taxonomy() {
126154
$atts = array_merge(
@@ -134,9 +162,13 @@ public function test_build_query_args_with_taxonomy() {
134162
$args = RandomPostOnRefresh::build_query_args( $atts );
135163
$this->assertEquals( array( 3, 4 ), $args['category__in'] );
136164
}
137-
165+
138166
/**
139167
* Test build_query_args with custom taxonomy and terms.
168+
*
169+
* @covers RandomPostOnRefresh::build_query_args
170+
* @covers RandomPostOnRefresh::list_to_array
171+
* @covers RandomPostOnRefresh::parse_id_list
140172
*/
141173
public function test_build_query_args_with_custom_taxonomy() {
142174
$atts = array_merge(
@@ -158,6 +190,9 @@ public function test_build_query_args_with_custom_taxonomy() {
158190

159191
/**
160192
* Test build_query_args with show=image and image_required=true.
193+
*
194+
* @covers RandomPostOnRefresh::build_query_args
195+
* @covers RandomPostOnRefresh::list_to_array
161196
*/
162197
public function test_build_query_args_with_image_required() {
163198
$atts = array_merge(
@@ -175,6 +210,9 @@ public function test_build_query_args_with_image_required() {
175210

176211
/**
177212
* Test build_query_args with orderby=random and order=invalid.
213+
*
214+
* @covers RandomPostOnRefresh::build_query_args
215+
* @covers RandomPostOnRefresh::list_to_array
178216
*/
179217
public function test_build_query_args_with_random_order() {
180218
$atts = array_merge(

0 commit comments

Comments
 (0)