function CssCollectionOptimizerLazyUnitTest::setUp
Overrides UnitTestCase::setUp
File
-
core/
tests/ Drupal/ Tests/ Core/ Asset/ CssCollectionOptimizerLazyUnitTest.php, line 42
Class
- CssCollectionOptimizerLazyUnitTest
- Tests the CSS asset optimizer.
Namespace
Drupal\Tests\Core\AssetCode
protected function setUp() : void {
parent::setUp();
$this->fileUrlGenerator = $this->createMock(FileUrlGeneratorInterface::class);
$this->fileUrlGenerator
->expects($this->any())
->method('generateString')
->with($this->isString())
->willReturnCallback(function ($uri) {
return 'generated-relative-url:' . $uri;
});
$this->optimizer = new CssOptimizer($this->fileUrlGenerator);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.