protected function CssOptimizerUnitTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Asset/ CssOptimizerUnitTest.php, line 35
Class
- CssOptimizerUnitTest
- 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
->isType('string'))
->willReturnCallback(function ($uri) {
return 'generated-relative-url:' . $uri;
});
$this->optimizer = new CssOptimizer($this->fileUrlGenerator);
}