Code Duplication    Length = 8-9 lines in 3 locations

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

@@ 241-248 (lines=8) @@
238
	 *
239
	 * @covers Automattic\Jetpack\Status::is_multi_network
240
	 */
241
	public function test_is_multi_network_when_multiple_networks() {
242
		$this->mock_wpdb_get_var( 2 );
243
		Functions\when( 'is_multisite' )->justReturn( true );
244
245
		$this->assertTrue( $this->status_obj->is_multi_network() );
246
247
		$this->clean_mock_wpdb_get_var();
248
	}
249
250
	/**
251
	 * Test cached is_single_user_site
@@ 269-277 (lines=9) @@
266
	 *
267
	 * @covers Automattic\Jetpack\Status::is_single_user_site
268
	 */
269
	public function test_is_single_user_site_with_one_user() {
270
		$this->mock_wpdb_get_var( 1 );
271
		Functions\when( 'get_transient' )->justReturn( false );
272
		Functions\when( 'set_transient' )->justReturn( true );
273
274
		$this->assertTrue( $this->status_obj->is_single_user_site() );
275
276
		$this->clean_mock_wpdb_get_var();
277
	}
278
279
	/**
280
	 * Test is_single_user_site with multiple users
@@ 284-292 (lines=9) @@
281
	 *
282
	 * @covers Automattic\Jetpack\Status::is_single_user_site
283
	 */
284
	public function test_is_single_user_site_with_multiple_users() {
285
		$this->mock_wpdb_get_var( 3 );
286
		Functions\when( 'get_transient' )->justReturn( false );
287
		Functions\when( 'set_transient' )->justReturn( true );
288
289
		$this->assertFalse( $this->status_obj->is_single_user_site() );
290
291
		$this->clean_mock_wpdb_get_var();
292
	}
293
294
	/**
295
	 * Mock $wpdb->get_var() and make it return a certain value.