Code Duplication    Length = 7-8 lines in 6 locations

projects/plugins/jetpack/tests/php/modules/masterbar/test-class-jetpack-admin-menu.php 4 locations

@@ 152-158 (lines=7) @@
149
	 *
150
	 * @covers ::add_posts_menu
151
	 */
152
	public function test_add_posts_menu() {
153
		global $menu;
154
155
		static::$admin_menu->add_posts_menu();
156
157
		$this->assertSame( 'https://wordpress.com/posts/' . static::$domain, array_shift( $menu )[2] );
158
	}
159
160
	/**
161
	 * Tests add_page_menu
@@ 165-171 (lines=7) @@
162
	 *
163
	 * @covers ::add_page_menu
164
	 */
165
	public function test_add_page_menu() {
166
		global $menu;
167
168
		static::$admin_menu->add_page_menu();
169
170
		$this->assertSame( 'https://wordpress.com/pages/' . static::$domain, array_shift( $menu )[2] );
171
	}
172
173
	/**
174
	 * Tests add_users_menu
@@ 178-184 (lines=7) @@
175
	 *
176
	 * @covers ::add_users_menu
177
	 */
178
	public function test_add_users_menu() {
179
		global $menu;
180
181
		static::$admin_menu->add_users_menu();
182
183
		$this->assertSame( 'https://wordpress.com/people/team/' . static::$domain, array_shift( $menu )[2] );
184
	}
185
186
	/**
187
	 * Tests add_users_menu
@@ 204-211 (lines=8) @@
201
	 *
202
	 * @covers ::add_plugins_menu
203
	 */
204
	public function test_add_plugins_menu() {
205
		global $menu;
206
207
		static::$admin_menu->add_plugins_menu( true );
208
209
		// Check Plugins menu always links to Calypso.
210
		$this->assertSame( 'https://wordpress.com/plugins/' . static::$domain, array_shift( $menu )[2] );
211
	}
212
}
213

projects/plugins/jetpack/tests/php/modules/masterbar/test-class-wpcom-admin-menu.php 1 location

@@ 262-269 (lines=8) @@
259
	 *
260
	 * @covers ::add_users_menu
261
	 */
262
	public function test_add_users_menu() {
263
		global $submenu;
264
265
		static::$admin_menu->add_users_menu( true );
266
267
		// Check that menu always links to Calypso.
268
		$this->assertSame( 'https://wordpress.com/people/team/' . static::$domain, array_shift( $submenu['users.php'] )[2] );
269
	}
270
271
	/**
272
	 * Tests add_tools_menu

projects/plugins/jetpack/tests/php/modules/masterbar/test-class-admin-menu.php 1 location

@@ 372-378 (lines=7) @@
369
	 *
370
	 * @covers ::add_options_menu
371
	 */
372
	public function test_add_options_menu() {
373
		global $submenu;
374
375
		static::$admin_menu->add_options_menu();
376
377
		$this->assertSame( 'https://wordpress.com/settings/general/' . static::$domain, array_shift( $submenu['options-general.php'] )[2] );
378
	}
379
380
	/**
381
	 * Tests add_jetpack_menu