public static function setFromDTO(OptionValue &$optionValue, OptionValueDTO $optionValueDTO)
 {
     $optionValue->setSku($optionValueDTO->sku);
     $optionValue->setName($optionValueDTO->name);
     $optionValue->setUnitPrice($optionValueDTO->unitPrice);
     $optionValue->setShippingWeight($optionValueDTO->shippingWeight);
     $optionValue->setSortOrder($optionValueDTO->sortOrder);
 }
 public function testCreate()
 {
     $option = $this->dummyData->getOption();
     $optionValue = new OptionValue($option);
     $optionValue->setSortOrder(2);
     $optionValue->setSku('MD');
     $optionValue->setName('Medium Shirt');
     $optionValue->setShippingWeight(16);
     $optionValue->setUnitPrice(500);
     $this->assertEntityValid($optionValue);
     $this->assertSame('MD', $optionValue->getSku());
     $this->assertSame('Medium Shirt', $optionValue->getName());
     $this->assertSame(16, $optionValue->getShippingWeight());
     $this->assertSame(2, $optionValue->getSortOrder());
     $this->assertSame($option, $optionValue->getOption());
     $this->assertTrue($optionValue->getPrice() instanceof Price);
 }
Example #3
0
 public function getOptionValue(Option $option = null)
 {
     if ($option === null) {
         $option = $this->getOption();
     }
     $optionValue = new OptionValue($option);
     $optionValue->setName('Option Value Name');
     $optionValue->setSku('OV-SKU');
     $optionValue->setShippingWeight(16);
     $optionValue->setSortOrder(0);
     $optionValue->setUnitPrice(100);
     return $optionValue;
 }