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-4.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
Tests the urlUpdate() method.
@dataProvider providerTestUrlUpdate
Paramètres
string $file: The file to test.
string $expected: The expected url string.
Fichier
-
tests/
src/ Kernel/ Asset/ CssOptimizerUnitTest.php, line 75
Classe
- 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->assertTrue(strstr($replaced_urls, $expected));
}