public function testCreateAndGetProductTemplateById()
 {
     $user = UserTestHelper::createBasicUser('Steven');
     $product = ProductTestHelper::createProductByNameForOwner('Product 1', $user);
     $productTemplate = ProductTemplateTestHelper::createProductTemplateByVariables($product, ProductTemplate::PRICE_FREQUENCY_ONE_TIME, ProductTemplate::TYPE_PRODUCT, ProductTemplate::STATUS_ACTIVE, SellPriceFormula::TYPE_EDITABLE);
     $this->assertTrue($productTemplate->save());
     $id = $productTemplate->id;
     $productTemplate->forget();
     unset($productTemplate);
     $productTemplate = ProductTemplate::getById($id);
     $this->assertEquals('Red Widget', $productTemplate->name);
     $this->assertEquals('Description', $productTemplate->description);
     $this->assertEquals(ProductTemplate::PRICE_FREQUENCY_ONE_TIME, intval($productTemplate->priceFrequency));
     $this->assertEquals(500.54, $productTemplate->cost->value);
     $this->assertEquals(400.54, $productTemplate->listPrice->value);
     $this->assertEquals(300.54, $productTemplate->sellPrice->value);
     $this->assertEquals(ProductTemplate::TYPE_PRODUCT, $productTemplate->type);
     $typeArray = ProductTemplateElementUtil::getProductTemplateTypeDropdownArray();
     $statusArray = ProductTemplateElementUtil::getProductTemplateStatusDropdownArray();
     $this->assertEquals("Product", $typeArray[$productTemplate->type]);
     $this->assertEquals(ProductTemplate::STATUS_ACTIVE, $productTemplate->status);
     $this->assertEquals("Active", $statusArray[$productTemplate->status]);
     $this->assertEquals($product, $productTemplate->products[0]);
     //$this->assertTrue($productTemplate->sellPriceFormula->isSame($sellPriceFormula));
     $this->assertEquals($productTemplate->sellPriceFormula->type, SellPriceFormula::TYPE_EDITABLE);
 }
 /**
  * @return array
  */
 protected static function resolveDropDownArray()
 {
     return ProductTemplateElementUtil::getProductTemplateStatusDropdownArray();
 }
 public function __construct($modelClassName, $attributeName)
 {
     parent::__construct($modelClassName, $attributeName);
     $this->dropDownValues = ProductTemplateElementUtil::getProductTemplateStatusDropdownArray();
 }
 public function getDropDownArray()
 {
     return ProductTemplateElementUtil::getProductTemplateStatusDropdownArray();
 }