Code Duplication    Length = 17-17 lines in 2 locations

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

@@ 277-293 (lines=17) @@
274
	 * @covers Automattic\Jetpack\Connection\Manager::delete_all_connection_tokens
275
	 * @throws MockEnabledException PHPUnit wasn't able to enable mock functions.
276
	 */
277
	public function test_delete_all_connection_tokens() {
278
		$this->update_option->enable();
279
		$this->get_option->enable();
280
		$this->apply_filters->enable();
281
		$this->do_action->enable();
282
283
		( new Plugin( 'plugin-slug-1' ) )->add( 'Plugin Name 1' );
284
285
		( new Plugin( 'plugin-slug-2' ) )->add( 'Plugin Name 2' );
286
287
		$stub = $this->createMock( Plugin::class );
288
		$stub->method( 'is_only' )
289
			->willReturn( false );
290
		$manager = ( new Manager() )->set_plugin_instance( $stub );
291
292
		$this->assertFalse( $manager->delete_all_connection_tokens() );
293
	}
294
295
	/**
296
	 * Unit test for the "Disconnect from WP" functionality.
@@ 301-317 (lines=17) @@
298
	 * @covers Automattic\Jetpack\Connection\Manager::disconnect_site_wpcom
299
	 * @throws MockEnabledException PHPUnit wasn't able to enable mock functions.
300
	 */
301
	public function test_disconnect_site_wpcom() {
302
		$this->update_option->enable();
303
		$this->get_option->enable();
304
		$this->apply_filters->enable();
305
		$this->do_action->enable();
306
307
		( new Plugin( 'plugin-slug-1' ) )->add( 'Plugin Name 1' );
308
309
		( new Plugin( 'plugin-slug-2' ) )->add( 'Plugin Name 2' );
310
311
		$stub = $this->createMock( Plugin::class );
312
		$stub->method( 'is_only' )
313
			->willReturn( false );
314
		$manager = ( new Manager() )->set_plugin_instance( $stub );
315
316
		$this->assertFalse( $manager->disconnect_site_wpcom() );
317
	}
318
319
	/**
320
	 * Test the `jetpack_connection_custom_caps' method.