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-admin-menu.php 1 location

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

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

@@ 271-278 (lines=8) @@
268
	 *
269
	 * @covers ::add_users_menu
270
	 */
271
	public function test_add_users_menu() {
272
		global $submenu;
273
274
		static::$admin_menu->add_users_menu( true );
275
276
		// Check that menu always links to Calypso.
277
		$this->assertSame( 'https://wordpress.com/people/team/' . static::$domain, array_shift( $submenu['users.php'] )[2] );
278
	}
279
280
	/**
281
	 * Tests add_tools_menu - "Show Advanced Dashboard Pages" off