Code Duplication    Length = 24-24 lines in 3 locations

packages/autoloader/tests/php/tests/test_integration_manifest.php 3 locations

@@ 64-87 (lines=24) @@
61
	/**
62
	 * Tests that the classmap manifest we generate can be read by the handler.
63
	 */
64
	public function test_that_handler_reads_classmap_manifests() {
65
		$this->write_test_manifest(
66
			'classmap',
67
			array(
68
				'TestFile' => array(
69
					'path'    => '$baseDir . \'/path_to_file.php\'',
70
					'version' => '1.0.0.0',
71
				),
72
			)
73
		);
74
75
		$loaded = array();
76
		$this->manifest_handler->register_plugin_manifests( 'test-manifest.php', $loaded );
77
78
		$this->assertEquals(
79
			array(
80
				'TestFile' => array(
81
					'version' => '1.0.0.0',
82
					'path'    => TEST_DATA_PATH . '/path_to_file.php',
83
				),
84
			),
85
			$loaded
86
		);
87
	}
88
89
	/**
90
	 * Tests that the PSR-4 manifest we generate can be read by the handler.
@@ 92-115 (lines=24) @@
89
	/**
90
	 * Tests that the PSR-4 manifest we generate can be read by the handler.
91
	 */
92
	public function test_that_handler_reads_psr4_manifests() {
93
		$this->write_test_manifest(
94
			'psr-4',
95
			array(
96
				'Automattic\\Jetpack\\' => array(
97
					'path'    => array( '$baseDir . \'/src\'' ),
98
					'version' => '1.2.0.0',
99
				),
100
			)
101
		);
102
103
		$loaded = array();
104
		$this->manifest_handler->register_plugin_manifests( 'test-manifest.php', $loaded );
105
106
		$this->assertEquals(
107
			array(
108
				'Automattic\\Jetpack\\' => array(
109
					'version' => '1.2.0.0',
110
					'path'    => array( TEST_DATA_PATH . '/src' ),
111
				),
112
			),
113
			$loaded
114
		);
115
	}
116
117
	/**
118
	 * Tests that the files manifest we generate can be read by the handler.
@@ 120-143 (lines=24) @@
117
	/**
118
	 * Tests that the files manifest we generate can be read by the handler.
119
	 */
120
	public function test_that_handler_reads_files_manifests() {
121
		$this->write_test_manifest(
122
			'files',
123
			array(
124
				'123d5a6s7vd' => array(
125
					'path'    => '$baseDir . \'/path_to_file.php\'',
126
					'version' => '1.3.0.0',
127
				),
128
			)
129
		);
130
131
		$loaded = array();
132
		$this->manifest_handler->register_plugin_manifests( 'test-manifest.php', $loaded );
133
134
		$this->assertEquals(
135
			array(
136
				'123d5a6s7vd' => array(
137
					'version' => '1.3.0.0',
138
					'path'    => TEST_DATA_PATH . '/path_to_file.php',
139
				),
140
			),
141
			$loaded
142
		);
143
	}
144
145
	/**
146
	 * Writes the test manifest for the tests to use.