Code Duplication    Length = 9-10 lines in 2 locations

packages/autoloader/tests/php/test_Autoloader.php 1 location

@@ 40-49 (lines=10) @@
37
	/**
38
	 * Tests whether enqueueing adds the latest class version to the global array.
39
	 */
40
	public function test_enqueueing_adds_the_latest_version_to_the_global_array() {
41
		$this->classes_handler->enqueue_package_class( 'className', '1', 'path_to_class' );
42
		$this->classes_handler->enqueue_package_class( 'className', '2', 'path_to_class_v2' );
43
44
		global $jetpack_packages_classmap;
45
		$this->assertTrue( isset( $jetpack_packages_classmap['className'] ) );
46
		$this->assertEquals( $jetpack_packages_classmap['className']['version'], '2' );
47
		$this->assertEquals( $jetpack_packages_classmap['className']['path'], 'path_to_class_v2' );
48
49
	}
50
51
	/**
52
	 * Tests whether enqueueing prioritizes the stable version of the class when the

packages/autoloader/tests/php/test_file_loader.php 1 location

@@ 38-46 (lines=9) @@
35
	/**
36
	 * Tests whether enqueueing adds the latest file version to the global array.
37
	 */
38
	public function test_enqueueing_adds_the_latest_version_to_the_global_array() {
39
		$this->files_handler->enqueue_package_file( 'file_id', '1', 'path_to_file' );
40
		$this->files_handler->enqueue_package_file( 'file_id', '2', 'path_to_file_v2' );
41
42
		global $jetpack_packages_filemap;
43
		$this->assertTrue( isset( $jetpack_packages_filemap['file_id'] ) );
44
		$this->assertEquals( $jetpack_packages_filemap['file_id']['version'], '2' );
45
		$this->assertEquals( $jetpack_packages_filemap['file_id']['path'], 'path_to_file_v2' );
46
	}
47
48
	/**
49
	 * Tests whether enqueueing prioritizes the dev version of the file when