/** * Don't get unit price from product */ public function UnitPrice() { if ($this->Product()->VariableAmount) { return $this->UnitPrice; } return parent::UnitPrice(); }
/** * Tries to create an order item with a non-existent version. */ function testProductVersionDoesNotExist() { $currentorder = ShoppingCart::current_order(); $brokenitem = new Product_OrderItem(array("ProductID" => $productSocks->ID, "ProductVersion" => 99999)); $this->assertEquals($brokenitem->UnitPrice(), null); //TODO: what should happen here??? }