Пример #1
0
 /**
  * @dataProvider getItems
  */
 public function testCalculate($items, $expected)
 {
     $totalCalculator = new TotalCalculator();
     $result = $totalCalculator->calculate($items);
     $this->assertEquals($expected, $result);
 }
Пример #2
0
 /**
  * @return $this
  */
 public function calculateTotal()
 {
     $this->totalPrice = $this->totalCalculator->calculate($this->cart);
     return $this;
 }