public function testGetAttributeFieldName() { $name = 'product[image]'; $attribute = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute', [], [], '', false); $attribute->expects($this->once())->method('getAttributeCode')->willReturn('image'); $this->formMock->expects($this->once())->method('addSuffixToName')->willReturn($name); $this->assertSame($name, $this->gallery->getAttributeFieldName($attribute)); }
public function testGetImagesJsonWithoutImages() { $this->content->setElement($this->galleryMock); $this->galleryMock->expects($this->once())->method('getImages')->willReturn(null); $this->assertSame('[]', $this->content->getImagesJson()); }