Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public function test_canOverwriteSku()
 {
     $this->assertEquals('sku', $this->product->get('sku'));
     $this->product->set('sku', 'sku3');
     $this->assertEquals('sku3', $this->product->get('sku'));
 }