File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 44
55namespace  Bavix \Wallet \Test \Units \Domain ;
66
7+ use  Bavix \Wallet \Interfaces \ProductInterface ;
78use  Bavix \Wallet \Objects \Cart ;
89use  Bavix \Wallet \Test \Infra \Factories \BuyerFactory ;
910use  Bavix \Wallet \Test \Infra \Factories \ItemFactory ;
@@ -95,7 +96,7 @@ public function testEagerLoaderPay(): void
9596        $ buyer  = BuyerFactory::new ()->create ();
9697        /** @var Item[] $products */ 
9798        $ products  = ItemFactory::times (50 )->create ([
98-             'quantity '  => 10 ,
99+             'quantity '  => 5 ,
99100            'price '  => 1 ,
100101        ]);
101102        $ productIds  = [];
@@ -104,15 +105,16 @@ public function testEagerLoaderPay(): void
104105            self ::assertSame (0 , $ product ->balanceInt );
105106        }
106107
108+         /** @var ProductInterface[] $products */ 
107109        $ products  = Item::query ()->whereKey ($ productIds )->get ()->all ();
108110
109111        $ cart  = app (Cart::class);
110112        foreach  ($ products  as  $ product ) {
111-             $ cart  = $ cart ->withItem ($ product , 10 );
113+             $ cart  = $ cart ->withItem ($ product , 5 );
112114        }
113115
114116        $ transfers  = $ buyer ->forcePayCart ($ cart );
115117        self ::assertSame ((int ) -$ cart ->getTotal ($ buyer ), $ buyer ->balanceInt );
116-         self ::assertCount (500 , $ transfers );
118+         self ::assertCount (250 , $ transfers );
117119    }
118120}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments