@@ -20,13 +20,16 @@ final class ComplexCalculationsTest extends RegularCashierTestCase
2020 public function test_calculations_are_accurate_in_stressful_situations (): void
2121 {
2222 $ summary = $ this ->initialSummary ();
23+
2324 $ this ->assertTotals ($ summary );
2425
2526 $ this ->cashier ->update (6 );
27+
28+
2629 $ this ->assertTotals (
2730 $ summary ->changeTo (
2831 quantity : 6 ,
29- subtotal : self ::money (170.3388 ),
32+ subtotal : self ::money (219.0000 ),
3033 totalTaxes : self ::money (48.6612 ),
3134 totalCharges : self ::money (10.9500 ),
3235 totalDiscounts: self ::money (32.2800 ),
@@ -53,10 +56,11 @@ public function test_calculations_are_accurate_in_stressful_situations(): void
5356 );
5457
5558 $ this ->cashier ->update (1 );
59+
5660 $ this ->assertTotals (
5761 $ summary ->changeTo (
5862 quantity : 1 ,
59- subtotal : self ::money (28.3898 ),
63+ subtotal : self ::money (36.5000 ),
6064 totalTaxes : self ::money (8.1102 ),
6165 totalCharges : self ::money (5.0 ),
6266 totalDiscounts: self ::money (7.5700 ),
@@ -92,8 +96,8 @@ private function initialSummary(): Summary
9296 {
9397 return Summary::is (
9498 quantity : 4 ,
95- unitPrice : self ::money (28.3898 ),
96- subtotal : self ::money (113.5592 ),
99+ unitPrice : self ::money (36.5000 ),
100+ subtotal : self ::money (146.0000 ),
97101 totalTaxes : self ::money (32.4408 ),
98102 totalCharges : self ::money (7.3000 ),
99103 totaDiscounts: self ::money (21.5200 ),
0 commit comments