/** * @param array $fixtureCacheConfig * @param array $frontendSettings * @param array $expectedFactoryArg * * @dataProvider initializationParamsDataProvider */ public function testInitializationParams(array $fixtureCacheConfig, array $frontendSettings, array $expectedFactoryArg) { $arguments = $this->getMock('Magento\\Framework\\App\\Arguments', array(), array(), '', false); $arguments->expects($this->once())->method('getCacheFrontendSettings')->will($this->returnValue($fixtureCacheConfig)); $frontendFactory = $this->getMock('Magento\\Framework\\App\\Cache\\Frontend\\Factory', array(), array(), '', false); $frontendFactory->expects($this->at(0))->method('create')->with($expectedFactoryArg); $model = new \Magento\Framework\App\Cache\Frontend\Pool($arguments, $frontendFactory, $frontendSettings); $model->current(); }
/** * @param array $fixtureCacheConfig * @param array $frontendSettings * @param array $expectedFactoryArg * * @dataProvider initializationParamsDataProvider */ public function testInitializationParams(array $fixtureCacheConfig, array $frontendSettings, array $expectedFactoryArg) { $deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false); $deploymentConfig->expects($this->once())->method('getSegment')->with(\Magento\Framework\App\DeploymentConfig\CacheConfig::CONFIG_KEY)->will($this->returnValue($fixtureCacheConfig)); $frontendFactory = $this->getMock('Magento\\Framework\\App\\Cache\\Frontend\\Factory', [], [], '', false); $frontendFactory->expects($this->at(0))->method('create')->with($expectedFactoryArg); $model = new \Magento\Framework\App\Cache\Frontend\Pool($deploymentConfig, $frontendFactory, $frontendSettings); $model->current(); }