Same name in other branches
  1. 6.0.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
  2. 8.x-3.x tests/src/Kernel/Asset/CssOptimizerUnitTest.php \Drupal\Tests\advagg\Kernel\Asset\CssOptimizerUnitTest::testUrlUpdate()
  3. 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\Asset

Code

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));
}