/** * @param CartProduct $product * @param $quantity */ public function __construct(CartProduct $product, $quantity) { $this->product = $product; $this->setQuantity($quantity); $this->setPrice($product->getPrice()); }
/** * @dataProvider dataForTestCreateProduct */ public function testCreateProduct($name, $price, $unit, CartProduct $product) { $this->assertEquals($name, $product->getName()); $this->assertEquals($price, $product->getPrice()); $this->assertEquals($unit, $product->getUnit()); }