/** * @dataProvider getItems */ public function testCalculate($items, $expected) { $totalCalculator = new TotalCalculator(); $result = $totalCalculator->calculate($items); $this->assertEquals($expected, $result); }
/** * @return $this */ public function calculateTotal() { $this->totalPrice = $this->totalCalculator->calculate($this->cart); return $this; }