Code Duplication    Length = 8-9 lines in 3 locations

packages/status/tests/php/test-status.php 3 locations

@@ 235-242 (lines=8) @@
232
	 *
233
	 * @covers Automattic\Jetpack\Status::is_multi_network
234
	 */
235
	public function test_is_multi_network_when_multiple_networks() {
236
		$this->mock_wpdb_get_var( 2 );
237
		Functions\when( 'is_multisite' )->justReturn( true );
238
239
		$this->assertTrue( $this->status_obj->is_multi_network() );
240
241
		$this->clean_mock_wpdb_get_var();
242
	}
243
244
	/**
245
	 * Test cached is_single_user_site
@@ 263-271 (lines=9) @@
260
	 *
261
	 * @covers Automattic\Jetpack\Status::is_single_user_site
262
	 */
263
	public function test_is_single_user_site_with_one_user() {
264
		$this->mock_wpdb_get_var( 1 );
265
		Functions\when( 'get_transient' )->justReturn( false );
266
		Functions\when( 'set_transient' )->justReturn( true );
267
268
		$this->assertTrue( $this->status_obj->is_single_user_site() );
269
270
		$this->clean_mock_wpdb_get_var();
271
	}
272
273
	/**
274
	 * Test is_single_user_site with multiple users
@@ 278-286 (lines=9) @@
275
	 *
276
	 * @covers Automattic\Jetpack\Status::is_single_user_site
277
	 */
278
	public function test_is_single_user_site_with_multiple_users() {
279
		$this->mock_wpdb_get_var( 3 );
280
		Functions\when( 'get_transient' )->justReturn( false );
281
		Functions\when( 'set_transient' )->justReturn( true );
282
283
		$this->assertFalse( $this->status_obj->is_single_user_site() );
284
285
		$this->clean_mock_wpdb_get_var();
286
	}
287
288
	/**
289
	 * Mock a global function with particular arguments and make it return a certain value.