Code Duplication    Length = 13-13 lines in 2 locations

projects/plugins/jetpack/tests/php/_inc/lib/test_class.rest-api-endpoints.php 2 locations

@@ 522-534 (lines=13) @@
519
	 *
520
	 * @since 4.4.0
521
	 */
522
	public function test_disconnect_site_auth_noparam() {
523
524
		// Create a user and set it up as current.
525
		$user = $this->create_and_get_user( 'administrator' );
526
		wp_set_current_user( $user->ID );
527
528
		// Create REST request in JSON format and dispatch
529
		$response = $this->create_and_get_request( 'connection', array(), 'POST' );
530
531
		// Fails because user is authenticated but missing a param
532
		$this->assertResponseStatus( 404, $response );
533
		$this->assertResponseData( array( 'code' => 'invalid_param' ), $response );
534
	}
535
536
	/**
537
	 * Test site disconnection with authenticated user and disconnected site
@@ 541-553 (lines=13) @@
538
	 *
539
	 * @since 4.4.0
540
	 */
541
	public function test_disconnect_site_auth_param_notconnected() {
542
543
		// Create a user and set it up as current.
544
		$user = $this->create_and_get_user( 'administrator' );
545
		wp_set_current_user( $user->ID );
546
547
		// Create REST request in JSON format and dispatch
548
		$response = $this->create_and_get_request( 'connection', array( 'isActive' => false ), 'POST' );
549
550
		// Fails because user is authenticated but site is not connected
551
		$this->assertResponseStatus( 400, $response );
552
		$this->assertResponseData( array( 'code' => 'disconnect_failed' ), $response );
553
	}
554
555
	/**
556
	 * Test site disconnection with authenticated user and connected site