Same name in other branches
- 5.0.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
- 6.0.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
- 8.x-3.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
Tests the urlUpdate() method.
@dataProvider providerTestUrlUpdate
Parameters
string $file: The file to test.
string $expected: The expected url string.
File
-
tests/
src/ Kernel/ Asset/ CssOptimizerUnitTest.php, line 75
Class
- CssOptimizerUnitTest
- Tests the CSS asset optimizer.
Namespace
Drupal\Tests\advagg\Kernel\AssetCode
public function testUrlUpdate($file, $expected) {
$path = $this->dir . 'css_test_files/' . $file;
$absolute_path = dirname(__FILE__) . '/css_test_files/';
$contents = file_get_contents($absolute_path . $file);
$replaced_urls = $this->optimizer
->updateUrls($contents, $path);
$this->assertNotFalse(strstr($replaced_urls, $expected));
}