/**
  * 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);
 }
Esempio n. 2
0
 /**
  * Transform content and/or content type for the specified preprocessing chain object
  *
  * @param PreProcessor\Chain $chain
  * @return void
  */
 public function process(PreProcessor\Chain $chain)
 {
     if (WorkflowType::CLIENT_SIDE_COMPILATION === $this->scopeConfig->getValue(WorkflowType::CONFIG_NAME_PATH)) {
         $this->frontendCompilation->process($chain);
     } else {
         $this->alternativeSource->process($chain);
     }
 }
 /**
  * Run test for process method (content not empty)
  */
 public function testProcessContentNotEmpty()
 {
     $chainMock = $this->getChainMock();
     $assetMock = $this->getAssetMock();
     $chainMock->expects(self::once())->method('getContent')->willReturn('test-content');
     $chainMock->expects(self::never())->method('getAsset')->willReturn($assetMock);
     $this->lockerProcessMock->expects(self::never())->method('lockProcess');
     $this->lockerProcessMock->expects(self::never())->method('unlockProcess');
     $frontendCompilation = new FrontendCompilation($this->assetSourceMock, $this->assetBuilderMock, $this->alternativeSourceMock, $this->lockerProcessMock, 'lock');
     $frontendCompilation->process($chainMock);
 }