Code Duplication    Length = 13-13 lines in 2 locations

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

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