Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 181-193 (lines=13) @@
178
	/**
179
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token).
180
	 */
181
	public function test_connection_reconnect_partial_blog_token_success() {
182
		$this->setup_reconnect_test( 'blog_token' );
183
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 );
184
185
		$response = $this->server->dispatch( $this->build_reconnect_request() );
186
		$this->assertEquals( 200, $response->get_status() );
187
188
		$data = $response->get_data();
189
		$this->assertEquals( 'completed', $data['status'] );
190
191
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 );
192
		$this->shutdown_reconnect_test( 'blog_token' );
193
	}
194
195
	/**
196
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
@@ 198-210 (lines=13) @@
195
	/**
196
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
197
	 */
198
	public function test_connection_reconnect_partial_blog_token_fail() {
199
		$this->setup_reconnect_test( 'blog_token' );
200
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 );
201
202
		$response = $this->server->dispatch( $this->build_reconnect_request() );
203
		$this->assertEquals( 500, $response->get_status() );
204
205
		$data = $response->get_data();
206
		$this->assertEquals( 'jetpack_secret', $data['code'] );
207
208
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 );
209
		$this->shutdown_reconnect_test( 'blog_token' );
210
	}
211
212
	/**
213
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (user token).