Code Duplication    Length = 13-13 lines in 2 locations

projects/packages/connection/tests/php/test-rest-endpoints.php 2 locations

@@ 256-268 (lines=13) @@
253
	/**
254
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token).
255
	 */
256
	public function test_connection_reconnect_partial_blog_token_success() {
257
		$this->setup_reconnect_test( 'blog_token' );
258
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 );
259
260
		$response = $this->server->dispatch( $this->build_reconnect_request() );
261
		$data     = $response->get_data();
262
263
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 );
264
		$this->shutdown_reconnect_test( 'blog_token' );
265
266
		$this->assertEquals( 200, $response->get_status() );
267
		$this->assertEquals( 'completed', $data['status'] );
268
	}
269
270
	/**
271
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
@@ 273-285 (lines=13) @@
270
	/**
271
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
272
	 */
273
	public function test_connection_reconnect_partial_blog_token_fail() {
274
		$this->setup_reconnect_test( 'blog_token' );
275
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 );
276
277
		$response = $this->server->dispatch( $this->build_reconnect_request() );
278
		$data     = $response->get_data();
279
280
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 );
281
		$this->shutdown_reconnect_test( 'blog_token' );
282
283
		$this->assertEquals( 500, $response->get_status() );
284
		$this->assertEquals( 'jetpack_secret', $data['code'] );
285
	}
286
287
	/**
288
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (user token).