public function test_CanTestForMissingFields() { $this->setExpectedException('Datapump\\Exception\\MissingProductData'); $requiredData = new RequiredData(); $requiredData->setSku('sku'); $product = new Simple($requiredData); $this->productholder->addProduct($product); }
public function test_AddConfigurableProductToHolder() { $product = new Configurable($this->configRequiredData, 'color'); $simpleproduct1 = new Simple(clone $this->simpleRequiredData); $simpleproduct1->set('color', 'blue'); $product->addSimpleProduct($simpleproduct1); $simpleproduct2 = new Simple(clone $this->simpleRequiredData); $simpleproduct2->set('sku', 'sku2'); $simpleproduct2->set('color', 'green'); $product->addSimpleProduct($simpleproduct2); $productholder = new ItemHolder(self::getLogger()); $productholder->addProduct($simpleproduct1)->addProduct($simpleproduct2); }
public function test_CanInjectData() { $this->itemholder->setMagmi(\Magmi_DataPumpFactory::getDataPumpInstance("productimport"), 'travis', ItemHolder::MAGMI_CREATE_UPDATE)->import(); }
public function test_canDebug() { $holder = new ItemHolder(self::getLogger()); $product1 = new Simple(clone $this->requiredData->setSku('sku-1')); $product2 = new Simple(clone $this->requiredData->setSku('sku-2')); $product3 = new Simple(clone $this->requiredData->setSku('sku-3')); $holder->addProduct(array($product1, $product2, $product3)); $debug = $holder->import(true); $this->assertTrue(is_array($debug)); }