/** * Test getter/setter for group */ public function testGetSetGroup() { $this->assertEquals(count($this->product->getGroups()), 0); // Change value and assert new $newGroup = new Group(); $this->product->addGroup($newGroup); $this->assertEquals($newGroup, $this->product->getGroups()->first()); $this->product->removeGroup($newGroup); $this->assertEmpty(count($this->product->getGroups()), 0); }
function it_throws_an_exception_if_a_soap_call_error_occured_during_normalization($groupRepository, $webservice, $group, $configurableNormalizer, Product $product, Family $family) { $groupRepository->getVariantGroupIds()->willReturn([0, 1]); $product->getGroups()->willReturn([$group]); $product->getFamily()->shouldBeCalled()->willReturn($family); $group->getCode()->willReturn('abcd'); $family->getCode()->willReturn('family_code'); $configurable = ['group' => $group, 'products' => [$product]]; $webservice->getConfigurablesStatus(['1' => $configurable])->shouldBeCalled()->willReturn([['sku' => 'conf-adcb']]); $webservice->getAttributeSetId('family_code')->shouldBeCalled()->willReturn('attrSet_code'); $configurableNormalizer->normalize($configurable, 'MagentoArray', Argument::any())->willThrow('Pim\\Bundle\\MagentoConnectorBundle\\Webservice\\SoapCallException'); $this->shouldThrow('\\Akeneo\\Bundle\\BatchBundle\\Item\\InvalidItemException')->duringProcess([$product]); }
/** * {@inheritDoc} */ public function getGroups() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getGroups', array()); return parent::getGroups(); }