Code Duplication    Length = 7-8 lines in 2 locations

packages/assets/tests/php/test-assets.php 2 locations

@@ 104-111 (lines=8) @@
101
	 * @param string $expected        Expected result.
102
	 * @param string $not_expected    Non expected result.
103
	 */
104
	public function test_get_file_url_for_environment( $min_path, $non_min_path, $is_script_debug, $expected, $not_expected ) {
105
		Constants::set_constant( 'SCRIPT_DEBUG', $is_script_debug );
106
		$file_url = Assets::get_file_url_for_environment( $min_path, $non_min_path );
107
108
		// note the double-$$ here, $(non_)min_path is referenced by var name.
109
		$this->assertStringContainsString( $$expected, $file_url );
110
		$this->assertStringNotContainsString( $$not_expected, $file_url );
111
	}
112
113
	/**
114
	 * Test that get_file_url_for_environment returns a full URL when given a full URL
@@ 140-146 (lines=7) @@
137
	 * @author       davidlonjon
138
	 * @dataProvider get_file_url_for_environment_package_path_data_provider
139
	 */
140
	public function test_get_file_url_for_environment_package_path( $min_path, $non_min_path, $package_path, $is_script_debug, $expected, $not_expected ) {
141
		Constants::set_constant( 'SCRIPT_DEBUG', $is_script_debug );
142
		$file_url = Assets::get_file_url_for_environment( $min_path, $non_min_path, $package_path );
143
144
		$this->assertStringContainsString( $expected, $file_url );
145
		$this->assertStringNotContainsString( $not_expected, $file_url );
146
	}
147
148
	/**
149
	 * Tests ability for a filter to map specific URLs.