diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-12-30 14:46:51 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2021-01-11 12:41:25 +0100 |
commit | c3cb2882682ef535d6ead7e5800185685cee024d (patch) | |
tree | 746c13c1fd884822e7e95b57eb12c28aae7cc347 | |
parent | 8b656e321bbf358d8074ce8a3976fac5defdece0 (diff) | |
download | nextcloud-server-c3cb2882682ef535d6ead7e5800185685cee024d.tar.gz nextcloud-server-c3cb2882682ef535d6ead7e5800185685cee024d.zip |
Bump scssphp/scssphp from 1.0.3 to 1.4.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
m--------- | 3rdparty | 0 | ||||
-rw-r--r-- | lib/private/Template/SCSSCacher.php | 13 | ||||
-rw-r--r-- | tests/lib/Template/SCSSCacherTest.php | 21 |
3 files changed, 19 insertions, 15 deletions
diff --git a/3rdparty b/3rdparty -Subproject 09596e43fba86a3643879595a8fb6fece4af6a7 +Subproject 7bbfe82c51aa168683ae6e47e3da7d3e587f6ca diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index 1c6ca661839..72685a5117c 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -47,8 +47,7 @@ use OCP\IMemcache; use OCP\IURLGenerator; use ScssPhp\ScssPhp\Compiler; use ScssPhp\ScssPhp\Exception\ParserException; -use ScssPhp\ScssPhp\Formatter\Crunched; -use ScssPhp\ScssPhp\Formatter\Expanded; +use ScssPhp\ScssPhp\OutputStyle; class SCSSCacher { @@ -313,14 +312,12 @@ class SCSSCacher { ]); // Continue after throw - $scss->setIgnoreErrors(true); if ($this->config->getSystemValue('debug')) { // Debug mode - $scss->setFormatter(Expanded::class); - $scss->setLineNumberStyle(Compiler::LINE_COMMENTS); + $scss->setOutputStyle(OutputStyle::EXPANDED); } else { // Compression - $scss->setFormatter(Crunched::class); + $scss->setOutputStyle(OutputStyle::COMPRESSED); } try { @@ -391,8 +388,8 @@ class SCSSCacher { $this->injectedVariables = null; // do not clear locks - $this->cacheFactory->createDistributed('SCSS-deps-')->clear(); - $this->cacheFactory->createDistributed('SCSS-cached-')->clear(); + $this->depsCache->clear(); + $this->isCachedCache->clear(); $appDirectory = $this->appData->getDirectoryListing(); foreach ($appDirectory as $folder) { diff --git a/tests/lib/Template/SCSSCacherTest.php b/tests/lib/Template/SCSSCacherTest.php index 4295c800d02..15966521a53 100644 --- a/tests/lib/Template/SCSSCacherTest.php +++ b/tests/lib/Template/SCSSCacherTest.php @@ -56,6 +56,8 @@ class SCSSCacherTest extends \Test\TestCase { /** @var ICache|\PHPUnit\Framework\MockObject\MockObject */ protected $depsCache; /** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */ + protected $isCachedCache; + /** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */ protected $cacheFactory; /** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */ protected $iconsCacher; @@ -88,9 +90,15 @@ class SCSSCacherTest extends \Test\TestCase { })); $this->cacheFactory = $this->createMock(ICacheFactory::class); $this->depsCache = $this->createMock(ICache::class); - $this->cacheFactory->expects($this->at(0)) + $this->isCachedCache = $this->createMock(ICache::class); + $this->cacheFactory ->method('createDistributed') - ->willReturn($this->depsCache); + ->withConsecutive() + ->willReturnOnConsecutiveCalls( + $this->depsCache, + $this->isCachedCache, + $this->createMock(ICache::class) + ); $this->themingDefaults = $this->createMock(ThemingDefaults::class); $this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn([]); @@ -537,11 +545,10 @@ class SCSSCacherTest extends \Test\TestCase { ->method('getDirectoryListing') ->willReturn([$file]); - $cache = $this->createMock(ICache::class); - $this->cacheFactory->expects($this->exactly(2)) - ->method('createDistributed') - ->willReturn($cache); - $cache->expects($this->exactly(2)) + $this->depsCache->expects($this->once()) + ->method('clear') + ->with(''); + $this->isCachedCache->expects($this->once()) ->method('clear') ->with(''); $this->appData->expects($this->once()) |