/** * @return void */ public function testModifyMeta() { $this->locatorMock->expects($this->once())->method('getProduct')->willReturn($this->productMock); $this->productMock->expects($this->once())->method('getTypeId'); $this->storeManagerMock->expects($this->once())->method('isSingleStoreMode'); $this->typeUploadMock->expects($this->once())->method('toOptionArray'); $this->urlBuilderMock->expects($this->once())->method('addSessionParam')->willReturnSelf(); $this->urlBuilderMock->expects($this->once())->method('getUrl'); $this->arrayManagerMock->expects($this->exactly(6))->method('set')->willReturn([]); $this->assertEquals([], $this->samples->modifyMeta([])); }
/** * @return void */ public function testModifyMeta() { $this->locatorMock->expects($this->once())->method('getProduct')->willReturn($this->productMock); $this->productMock->expects($this->any())->method('getTypeId'); $this->storeManagerMock->expects($this->exactly(2))->method('isSingleStoreMode'); $this->typeUploadMock->expects($this->exactly(2))->method('toOptionArray'); $this->shareableMock->expects($this->once())->method('toOptionArray'); $this->urlBuilderMock->expects($this->exactly(2))->method('addSessionParam')->willReturnSelf(); $this->urlBuilderMock->expects($this->exactly(2))->method('getUrl'); $currencyMock = $this->getMock(\Magento\Directory\Model\Currency::class, [], [], '', false); $currencyMock->expects($this->once())->method('getCurrencySymbol'); $storeMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)->setMethods(['getBaseCurrency'])->getMockForAbstractClass(); $storeMock->expects($this->once())->method('getBaseCurrency')->willReturn($currencyMock); $this->locatorMock->expects($this->once())->method('getStore')->willReturn($storeMock); $this->arrayManagerMock->expects($this->exactly(9))->method('set')->willReturn([]); $this->assertEquals([], $this->links->modifyMeta([])); }