context = $this->getMockBuilder(Context::class) ->disableOriginalConstructor() ->getMock(); $this->registry = $this->getMockBuilder(Registry::class) ->disableOriginalConstructor() ->getMock(); $this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class) ->getMockForAbstractClass(); $this->typeList = $this->getMockBuilder(TypeListInterface::class) ->getMockForAbstractClass(); $this->storeResolver = $this->getMockBuilder(StoreResolver::class) ->disableOriginalConstructor() ->getMock(); $this->storeManager = $this->getMockBuilder(StoreManagerInterface::class) ->getMockForAbstractClass(); $this->model = new Value( $this->context, $this->registry, $this->scopeConfig, $this->typeList, $this->storeResolver, $this->storeManager ); } /** * Check that getIdentities() method returns specified cache tag */ public function testGetIdentities() { $storeId = 1; $storeMock = $this->getMockBuilder(StoreInterface::class) ->getMockForAbstractClass(); $this->storeManager->expects($this->once()) ->method('getStore') ->willReturn($storeMock); $storeMock->expects($this->once()) ->method('getId') ->willReturn($storeId); $expected = [ Value::CACHE_TAG . '_' . $storeId, ]; $this->assertEquals($expected, $this->model->getIdentities()); } }