Code Duplication    Length = 12-12 lines in 2 locations

packages/connection/tests/php/test_Manager.php 2 locations

@@ 240-251 (lines=12) @@
237
	 *
238
	 * @covers Automattic\Jetpack\Connection\Manager::is_user_connected
239
	 */
240
	public function test_is_user_connected_with_default_user_id_logged_in() {
241
		$this->mock_function( 'get_current_user_id', 1 );
242
		$access_token = (object) array(
243
			'secret'           => 'abcd1234',
244
			'external_user_id' => 1,
245
		);
246
		$this->manager->expects( $this->once() )
247
			->method( 'get_access_token' )
248
			->will( $this->returnValue( $access_token ) );
249
250
		$this->assertTrue( $this->manager->is_user_connected() );
251
	}
252
253
	/**
254
	 * Test the `is_user_connected` functionality.
@@ 258-269 (lines=12) @@
255
	 *
256
	 * @covers Automattic\Jetpack\Connection\Manager::is_user_connected
257
	 */
258
	public function test_is_user_connected_with_user_id_logged_in() {
259
		$this->mock_function( 'absint', 1 );
260
		$access_token = (object) array(
261
			'secret'           => 'abcd1234',
262
			'external_user_id' => 1,
263
		);
264
		$this->manager->expects( $this->once() )
265
			->method( 'get_access_token' )
266
			->will( $this->returnValue( $access_token ) );
267
268
		$this->assertTrue( $this->manager->is_user_connected( 1 ) );
269
	}
270
271
	/**
272
	 * Unit test for the "Delete all tokens" functionality.