/**
  * @return void
  */
 public function testModifyMeta()
 {
     $this->locatorMock->expects($this->exactly(2))->method('getProduct')->willReturn($this->productMock);
     $this->productMock->expects($this->any())->method('getTypeId');
     $this->arrayManagerMock->expects($this->exactly(3))->method('set')->willReturn([]);
     $this->assertEquals([], $this->downloadablePanel->modifyMeta([]));
 }
 protected function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->locatorMock = $this->getMockBuilder(LocatorInterface::class)->getMockForAbstractClass();
     $this->productMock = $this->getMockBuilder(ProductInterface::class)->getMockForAbstractClass();
     $this->locatorMock->expects($this->any())->method('getProduct')->willReturn($this->productMock);
     $this->arrayManagerMock = $this->getMockBuilder(ArrayManager::class)->disableOriginalConstructor()->getMock();
     $this->arrayManagerMock->expects($this->any())->method('get')->willReturnArgument(3);
 }
 /**
  * @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([]));
 }
예제 #5
0
 protected function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->locatorMock = $this->getMockBuilder(LocatorInterface::class)->getMockForAbstractClass();
     $this->productMock = $this->getMockBuilder(ProductInterface::class)->setMethods(['getStoreId', 'getResource', 'getData', 'getAttributes', 'getStore', 'getAttributeDefaultValue', 'getExistsStoreValueFlag'])->getMockForAbstractClass();
     $this->storeMock = $this->getMockBuilder(StoreInterface::class)->setMethods(['load', 'getId', 'getConfig'])->getMockForAbstractClass();
     $this->arrayManagerMock = $this->getMockBuilder(ArrayManager::class)->disableOriginalConstructor()->getMock();
     $this->arrayManagerMock->expects($this->any())->method('replace')->willReturnArgument(1);
     $this->arrayManagerMock->expects($this->any())->method('get')->willReturnArgument(2);
     $this->arrayManagerMock->expects($this->any())->method('set')->willReturnArgument(1);
     $this->arrayManagerMock->expects($this->any())->method('merge')->willReturnArgument(1);
     $this->arrayManagerMock->expects($this->any())->method('remove')->willReturnArgument(1);
     $this->locatorMock->expects($this->any())->method('getProduct')->willReturn($this->productMock);
     $this->locatorMock->expects($this->any())->method('getStore')->willReturn($this->storeMock);
 }