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