コード例 #1
0
ファイル: PoolTest.php プロジェクト: whoople/magento2-testing
 /**
  * @param string $sourceContentType
  * @param string $targetContentType
  * @param array $expectedResult
  *
  * @dataProvider getPreProcessorsDataProvider
  */
 public function testProcess($sourceContentType, $targetContentType, array $expectedResult)
 {
     $this->processorChain->expects($this->any())->method('getOrigContentType')->willReturn($sourceContentType);
     $this->processorChain->expects($this->any())->method('getTargetContentType')->willReturn($targetContentType);
     $processorMaps = [];
     foreach ($expectedResult as $processor) {
         $processorMock = $this->getMock($processor, ['process'], [], '', false);
         $processorMock->expects($this->any())->method('process')->with($this->processorChain);
         $processorMaps[] = [$processor, $processorMock];
     }
     $this->objectManager->expects(static::atLeastOnce())->method('get')->willReturnMap($processorMaps);
     $this->processorPool->process($this->processorChain);
 }