File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -265,10 +265,10 @@ public function testPayCustomPrice(): void
265265 {
266266 /**
267267 * @var Buyer $buyer
268- * @var Item $product
268+ * @var Item $productIn
269269 */
270270 $ buyer = BuyerFactory::new ()->create ();
271- $ product = ItemFactory::new ( )->create ([
271+ [ $ productIn , $ productOutside ] = ItemFactory::times ( 2 )->create ([
272272 'quantity ' => 2 ,
273273 'price ' => 5_000 ,
274274 ]);
@@ -279,13 +279,15 @@ public function testPayCustomPrice(): void
279279 self ::assertSame (6_000 + (int ) $ buyer ->getKey (), $ buyer ->balanceInt );
280280
281281 $ cart = app (Cart::class)
282- ->withItem ($ product , pricePerItem: 1_000 )
283- ->withItem ($ product )
282+ ->withItem ($ productIn , pricePerItem: 1_000 )
283+ ->withItem ($ productIn )
284284 ;
285285
286286 self ::assertSame (6_000 + (int ) $ buyer ->getKey (), (int ) $ cart ->getTotal ($ buyer ));
287287
288288 $ transfers = $ buyer ->payCart ($ cart );
289+ self ::assertSame (0 , $ cart ->getQuantity ($ productOutside ));
290+ self ::assertSame (2 , $ cart ->getQuantity ($ productIn ));
289291 self ::assertSame (0 , $ buyer ->balanceInt );
290292 self ::assertCount (2 , $ transfers );
291293 }
You can’t perform that action at this time.
0 commit comments