|
@@ 27-34 (lines=8) @@
|
| 24 |
|
* @param string $expected Expected result. |
| 25 |
|
* @param string $not_expected Non expected result. |
| 26 |
|
*/ |
| 27 |
|
public function test_get_file_url_for_environment( $min_path, $non_min_path, $is_script_debug, $expected, $not_expected ) { |
| 28 |
|
Constants::set_constant( 'SCRIPT_DEBUG', $is_script_debug ); |
| 29 |
|
$file_url = Assets::get_file_url_for_environment( $min_path, $non_min_path ); |
| 30 |
|
|
| 31 |
|
// note the double-$$ here, $(non_)min_path is referenced by var name. |
| 32 |
|
$this->assertContains( $$expected, $file_url ); |
| 33 |
|
$this->assertNotContains( $$not_expected, $file_url ); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
/** |
| 37 |
|
* Test that get_file_url_for_environment returns a full URL when given a full URL |
|
@@ 63-69 (lines=7) @@
|
| 60 |
|
* @author davidlonjon |
| 61 |
|
* @dataProvider get_file_url_for_environment_package_path_data_provider |
| 62 |
|
*/ |
| 63 |
|
public function test_get_file_url_for_environment_package_path( $min_path, $non_min_path, $package_path, $is_script_debug, $expected, $not_expected ) { |
| 64 |
|
Constants::set_constant( 'SCRIPT_DEBUG', $is_script_debug ); |
| 65 |
|
$file_url = Assets::get_file_url_for_environment( $min_path, $non_min_path, $package_path ); |
| 66 |
|
|
| 67 |
|
$this->assertContains( $expected, $file_url ); |
| 68 |
|
$this->assertNotContains( $not_expected, $file_url ); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
/** |
| 72 |
|
* Tests ability for a filter to map specific URLs. |