Skip to content

Commit 85efa82

Browse files
authored
Remove some tests with invalid argument type (#251)
See #243 (comment)
1 parent a9665a7 commit 85efa82

File tree

2 files changed

+10
-33
lines changed

2 files changed

+10
-33
lines changed

tests/data/_get_list_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
assertType('false', _get_list_table('Unknown_Table'));
1313

1414
// Unknown class name
15-
assertType('WP_List_Table|false', _get_list_table($_GET['foo']));
15+
/** @var class-string $classString */
16+
assertType('WP_List_Table|false', _get_list_table($classString));

tests/data/echo_key.php

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,86 +63,65 @@
6363
$args = ['echo' => $_GET['foo']];
6464
assertType('string|void', get_search_form($args));
6565
assertType('string|void', the_title_attribute($args));
66-
assertType('string|void', wp_get_archives($args));
66+
assertType('string|void', wp_link_pages($args));
6767
assertType('string|void', wp_list_authors($args));
68-
assertType('string|void', wp_list_bookmarks($args));
69-
assertType('string|void|false', wp_list_categories($args));
7068
assertType('string|void', wp_list_comments($args));
71-
assertType('string|void', wp_list_pages($args));
7269
assertType('string|void', wp_list_users($args));
7370
assertType('string|void', wp_login_form($args));
7471
assertType('string|void', wp_page_menu($args));
7572

7673
// Explicit no query string value
7774
$args = 'akey=avalue';
7875
assertType('void', the_title_attribute($args));
79-
assertType('void', wp_get_archives($args));
76+
assertType('void', wp_link_pages($args));
8077
assertType('void', wp_list_authors($args));
81-
assertType('void', wp_list_bookmarks($args));
82-
assertType('void|false', wp_list_categories($args));
8378
assertType('void', wp_list_comments($args));
84-
assertType('void', wp_list_pages($args));
8579
assertType('void', wp_list_users($args));
8680
assertType('void', wp_page_menu($args));
8781

8882
// Explicit non empty non numeric query string value (includes 'true' & 'false')
8983
$args = 'echo=nonemptynonnumeric&akey=avalue';
9084
assertType('void', the_title_attribute($args));
91-
assertType('void', wp_get_archives($args));
85+
assertType('void', wp_link_pages($args));
9286
assertType('void', wp_list_authors($args));
93-
assertType('void', wp_list_bookmarks($args));
94-
assertType('void|false', wp_list_categories($args));
9587
assertType('void', wp_list_comments($args));
96-
assertType('void', wp_list_pages($args));
9788
assertType('void', wp_list_users($args));
9889
assertType('void', wp_page_menu($args));
9990

10091
// Explicit non zero numeric query string value
10192
$args = 'echo=1&akey=avalue';
10293
assertType('void', the_title_attribute($args));
103-
assertType('void', wp_get_archives($args));
94+
assertType('void', wp_link_pages($args));
10495
assertType('void', wp_list_authors($args));
105-
assertType('void', wp_list_bookmarks($args));
106-
assertType('void|false', wp_list_categories($args));
10796
assertType('void', wp_list_comments($args));
108-
assertType('void', wp_list_pages($args));
10997
assertType('void', wp_list_users($args));
11098
assertType('void', wp_page_menu($args));
11199

112100
// Explicit query string value of 0
113101
$args = 'echo=0&akey=avalue';
114102
assertType('string|void', the_title_attribute($args));
115-
assertType('string|void', wp_get_archives($args));
103+
assertType('string', wp_link_pages($args));
116104
assertType('string', wp_list_authors($args));
117-
assertType('string', wp_list_bookmarks($args));
118-
assertType('string|false', wp_list_categories($args));
119105
assertType('string|void', wp_list_comments($args));
120-
assertType('string', wp_list_pages($args));
121106
assertType('string', wp_list_users($args));
122107
assertType('string', wp_page_menu($args));
123108

124109
// Explicit empty query string value
125110
$args = 'echo=&akey=avalue';
126111
assertType('string|void', the_title_attribute($args));
127-
assertType('string|void', wp_get_archives($args));
112+
assertType('string', wp_link_pages($args));
128113
assertType('string', wp_list_authors($args));
129-
assertType('string', wp_list_bookmarks($args));
130-
assertType('string|false', wp_list_categories($args));
131114
assertType('string|void', wp_list_comments($args));
132-
assertType('string', wp_list_pages($args));
133115
assertType('string', wp_list_users($args));
134116
assertType('string', wp_page_menu($args));
135117

136118
// Unknown value
137119
$args = $_GET['foo'];
138120
assertType('string|void', get_search_form($args));
139121
assertType('string|void', the_title_attribute($args));
140-
assertType('string|void', wp_get_archives($args));
122+
assertType('string|void', wp_link_pages($args));
141123
assertType('string|void', wp_list_authors($args));
142-
assertType('string|void', wp_list_bookmarks($args));
143-
assertType('string|void|false', wp_list_categories($args));
144124
assertType('string|void', wp_list_comments($args));
145-
assertType('string|void', wp_list_pages($args));
146125
assertType('string|void', wp_list_users($args));
147126
assertType('string|void', wp_login_form($args));
148127
assertType('string|void', wp_page_menu($args));
@@ -152,12 +131,9 @@
152131
$args = '';
153132
assertType('string|void', get_search_form($args));
154133
assertType('string|void', the_title_attribute($args));
155-
assertType('string|void', wp_get_archives($args));
134+
assertType('string|void', wp_link_pages($args));
156135
assertType('string|void', wp_list_authors($args));
157-
assertType('string|void', wp_list_bookmarks($args));
158-
assertType('string|void|false', wp_list_categories($args));
159136
assertType('string|void', wp_list_comments($args));
160-
assertType('string|void', wp_list_pages($args));
161137
assertType('string|void', wp_list_users($args));
162138
assertType('string|void', wp_login_form($args));
163139
assertType('string|void', wp_page_menu($args));

0 commit comments

Comments
 (0)