Added more tests
This commit is contained in:
Patrick Henninger
2019-01-08 20:00:28 +01:00
parent fe2d61160a
commit 5d117a0acd
7 changed files with 211 additions and 21 deletions

View File

@@ -28,11 +28,12 @@ class BuyableProduct implements Buyable
* @param string $name
* @param float $price
*/
public function __construct($id = 1, $name = 'Item name', $price = 10.00)
public function __construct($id = 1, $name = 'Item name', $price = 10.00, $weight = 0)
{
$this->id = $id;
$this->name = $name;
$this->price = $price;
$this->weight = $weight;
}
/**
@@ -64,4 +65,14 @@ class BuyableProduct implements Buyable
{
return $this->price;
}
/**
* Get the price of the Buyable item.
*
* @return float
*/
public function getBuyableWeight($options = null)
{
return $this->weight;
}
}