@@ 262-277 (lines=16) @@ | ||
259 | * |
|
260 | * @return array Test results. |
|
261 | */ |
|
262 | public static function passing_test( $args ) { |
|
263 | return wp_parse_args( |
|
264 | $args, |
|
265 | array( |
|
266 | 'name' => 'unnamed_test', |
|
267 | 'label' => false, |
|
268 | 'pass' => true, |
|
269 | 'short_description' => __( 'Test passed!', 'jetpack' ), |
|
270 | 'long_description' => false, |
|
271 | 'severity' => false, |
|
272 | 'action' => false, |
|
273 | 'action_label' => false, |
|
274 | 'show_in_site_health' => true, |
|
275 | ) |
|
276 | ); |
|
277 | } |
|
278 | ||
279 | /** |
|
280 | * Helper function to return consistent responses for a skipped test. |
|
@@ 296-311 (lines=16) @@ | ||
293 | * |
|
294 | * @return array Test results. |
|
295 | */ |
|
296 | public static function skipped_test( $args = array() ) { |
|
297 | return wp_parse_args( |
|
298 | $args, |
|
299 | array( |
|
300 | 'name' => 'unnamed_test', |
|
301 | 'label' => false, |
|
302 | 'pass' => 'skipped', |
|
303 | 'short_description' => false, |
|
304 | 'long_description' => false, |
|
305 | 'severity' => false, |
|
306 | 'action' => false, |
|
307 | 'action_label' => false, |
|
308 | 'show_in_site_health' => true, |
|
309 | ) |
|
310 | ); |
|
311 | } |
|
312 | ||
313 | /** |
|
314 | * Helper function to return consistent responses for a failing test. |
|
@@ 332-347 (lines=16) @@ | ||
329 | * |
|
330 | * @return array Test results. |
|
331 | */ |
|
332 | public static function failing_test( $args ) { |
|
333 | return wp_parse_args( |
|
334 | $args, |
|
335 | array( |
|
336 | 'name' => 'unnamed_test', |
|
337 | 'label' => false, |
|
338 | 'pass' => false, |
|
339 | 'short_description' => __( 'Test failed!', 'jetpack' ), |
|
340 | 'long_description' => false, |
|
341 | 'severity' => 'critical', |
|
342 | 'action' => false, |
|
343 | 'action_label' => false, |
|
344 | 'show_in_site_health' => true, |
|
345 | ) |
|
346 | ); |
|
347 | } |
|
348 | ||
349 | /** |
|
350 | * Provide WP_CLI friendly testing results. |