Code Duplication    Length = 7-8 lines in 3 locations

projects/plugins/jetpack/tests/php/_inc/lib/test_class.rest-api-authentication.php 1 location

@@ 356-362 (lines=7) @@
353
		$this->assertEquals( self::$admin_id, get_current_user_id() );
354
	}
355
356
	public function mock_jetpack_private_options( $value, $option_name ) {
357
		$user_tokens = array();
358
		$user_tokens[ self::$admin_id ] = 'pretend_this_is_valid.secret.' . self::$admin_id;
359
		return array(
360
			'user_tokens' => $user_tokens,
361
		);
362
	}
363
364
	/**
365
	 * Ensures that these tests pass through Jetpack::wp_rest_authenticate,

projects/plugins/jetpack/tests/php/modules/post-by-email/test-class.post-by-email-api.php 1 location

@@ 180-187 (lines=8) @@
177
	 *
178
	 * @return array
179
	 */
180
	public function mock_jetpack_private_options() {
181
		$user_tokens                    = array();
182
		$user_tokens[ self::$admin_id ] = 'pretend_this_is_valid.secret.' . self::$admin_id;
183
184
		return array(
185
			'user_tokens' => $user_tokens,
186
		);
187
	}
188
189
	/**
190
	 * Ensures that these tests pass through Jetpack::wp_rest_authenticate,

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-callables.php 1 location

@@ 1094-1100 (lines=7) @@
1091
	/**
1092
	 * Mock Jetpack private options.
1093
	 */
1094
	public function mock_jetpack_private_options() {
1095
		$user_tokens                    = array();
1096
		$user_tokens[ self::$admin_id ] = 'pretend_this_is_valid.secret.' . self::$admin_id;
1097
		return array(
1098
			'user_tokens' => $user_tokens,
1099
		);
1100
	}
1101
1102
	/**
1103
	 * Test "get_timezone_from_timezone_string".