Code Duplication    Length = 19-19 lines in 4 locations

_inc/lib/debugger/class-jetpack-cxn-test-base.php 4 locations

@@ 261-279 (lines=19) @@
258
	 *
259
	 * @return array Test results.
260
	 */
261
	public static function passing_test( $args ) {
262
		$args = wp_parse_args(
263
			$args,
264
			array(
265
				'name'                => 'unnamed_test',
266
				'label'               => false,
267
				'short_description'   => __( 'Test passed!', 'jetpack' ),
268
				'long_description'    => false,
269
				'severity'            => false,
270
				'action'              => false,
271
				'action_label'        => false,
272
				'show_in_site_health' => true,
273
			)
274
		);
275
276
		$args['pass'] = true;
277
278
		return $args;
279
	}
280
281
	/**
282
	 * Helper function to return consistent responses for a skipped test.
@@ 297-315 (lines=19) @@
294
	 *
295
	 * @return array Test results.
296
	 */
297
	public static function skipped_test( $args = array() ) {
298
		$args = wp_parse_args(
299
			$args,
300
			array(
301
				'name'                => 'unnamed_test',
302
				'label'               => false,
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
		$args['pass'] = 'skipped';
313
314
		return $args;
315
	}
316
317
	/**
318
	 * Helper function to return consistent responses for an informational test.
@@ 333-351 (lines=19) @@
330
	 *
331
	 * @return array Test results.
332
	 */
333
	public static function informational_test( $args = array() ) {
334
		$args = wp_parse_args(
335
			$args,
336
			array(
337
				'name'                => 'unnamed_test',
338
				'label'               => false,
339
				'short_description'   => false,
340
				'long_description'    => false,
341
				'severity'            => false,
342
				'action'              => false,
343
				'action_label'        => false,
344
				'show_in_site_health' => true,
345
			)
346
		);
347
348
		$args['pass'] = 'informational';
349
350
		return $args;
351
	}
352
353
	/**
354
	 * Helper function to return consistent responses for a failing test.
@@ 371-389 (lines=19) @@
368
	 *
369
	 * @return array Test results.
370
	 */
371
	public static function failing_test( $args ) {
372
		$args = wp_parse_args(
373
			$args,
374
			array(
375
				'name'                => 'unnamed_test',
376
				'label'               => false,
377
				'short_description'   => __( 'Test failed!', 'jetpack' ),
378
				'long_description'    => false,
379
				'severity'            => 'critical',
380
				'action'              => false,
381
				'action_label'        => false,
382
				'show_in_site_health' => true,
383
			)
384
		);
385
386
		$args['pass'] = false;
387
388
		return $args;
389
	}
390
391
	/**
392
	 * Provide WP_CLI friendly testing results.