/** * Run test for process method */ public function testProcessAlternativeSource() { $chainMock = $this->getChainMock(); $this->scopeConfigMock->expects(self::once())->method('getValue')->with(WorkflowType::CONFIG_NAME_PATH)->willReturn('off'); $this->alternativeSourceMock->expects(self::once())->method('process')->with($chainMock); $this->frontendCompilationMock->expects(self::never())->method('process'); $this->preprocessorStrategy->process($chainMock); }
/** * Run test for process method */ public function testProcess() { $this->lockerProcessMock->expects(self::once())->method('lockProcess')->with(self::isType('string')); $this->lockerProcessMock->expects(self::once())->method('unlockProcess'); $assetMock = $this->getAssetNew(); $this->assetBuilderMock->expects(self::once())->method('setArea')->with(self::AREA)->willReturnSelf(); $this->assetBuilderMock->expects(self::once())->method('setTheme')->with(self::THEME)->willReturnSelf(); $this->assetBuilderMock->expects(self::once())->method('setLocale')->with(self::LOCALE)->willReturnSelf(); $this->assetBuilderMock->expects(self::once())->method('setModule')->with(self::MODULE)->willReturnSelf(); $this->assetBuilderMock->expects(self::once())->method('setPath')->with(self::FILE_PATH)->willReturnSelf(); $this->assetBuilderMock->expects(self::once())->method('build')->willReturn($assetMock); $this->alternativeSourceMock->expects(self::once())->method('getAlternativesExtensionsNames')->willReturn(['less']); $this->assetSourceMock->expects(self::once())->method('getContent')->with($assetMock)->willReturn(self::NEW_CONTENT); $frontendCompilation = new FrontendCompilation($this->assetSourceMock, $this->assetBuilderMock, $this->alternativeSourceMock, $this->lockerProcessMock, 'lock'); $frontendCompilation->process($this->getChainMockExpects()); }