@@ -67,6 +67,27 @@ public function testSafe(): void
6767        self ::assertFalse ($ transactionconfirmed );
6868    }
6969
70+     public  function  testSafeConfirmedInvalid (): void 
71+     {
72+         /** @var Buyer $buyer */ 
73+         $ buyernew ()->create ();
74+         $ wallet$ buyerwallet ;
75+ 
76+         self ::assertSame (0 , $ walletbalanceInt );
77+ 
78+         $ transaction$ walletforceWithdraw (1000 , [
79+             'desc '  => 'confirmed ' ,
80+         ]);
81+ 
82+         self ::assertSame (-1000 , $ walletbalanceInt );
83+         self ::assertTrue ($ transactionconfirmed );
84+         self ::assertTrue ($ transactiongetKey () > 0 );
85+ 
86+         self ::assertTrue ($ walletsafeConfirm ($ transaction
87+         self ::assertSame (-1000 , $ walletbalanceInt );
88+         self ::assertTrue ($ transactionconfirmed );
89+     }
90+ 
7091    public  function  testSafeResetConfirm (): void 
7192    {
7293        /** @var Buyer $buyer */ 
@@ -127,6 +148,25 @@ public function testForce(): void
127148        self ::assertTrue ($ transactionconfirmed );
128149    }
129150
151+     public  function  testForceConfirmedInvalid (): void 
152+     {
153+         $ this expectException (ConfirmedInvalid::class);
154+         $ this expectExceptionCode (ExceptionInterface::CONFIRMED_INVALID );
155+         $ this expectExceptionMessageStrict (trans ('wallet::errors.confirmed_invalid ' ));
156+ 
157+         /** @var Buyer $buyer */ 
158+         $ buyernew ()->create ();
159+         $ wallet$ buyerwallet ;
160+ 
161+         self ::assertSame (0 , $ walletbalanceInt );
162+ 
163+         $ transaction$ walletforceWithdraw (1000 );
164+         self ::assertSame (-1000 , $ walletbalanceInt );
165+         self ::assertTrue ($ transactionconfirmed );
166+ 
167+         $ walletforceConfirm ($ transaction
168+     }
169+ 
130170    public  function  testUnconfirmed (): void 
131171    {
132172        /** @var Buyer $buyer */ 
@@ -198,6 +238,31 @@ public function testSafeUnconfirmed(): void
198238        self ::assertTrue ($ walletsafeResetConfirm ($ transaction
199239    }
200240
241+     public  function  testSafeUnconfirmedWalletOwnerInvalid (): void 
242+     {
243+         /** 
244+          * @var Buyer $buyer1 
245+          * @var Buyer $buyer2 
246+          **/ 
247+         [$ buyer1$ buyer2times (2 )->create ();
248+         $ wallet1$ buyer1wallet ;
249+         $ wallet2$ buyer2wallet ;
250+ 
251+         self ::assertTrue ($ wallet1saveOrFail ());
252+         self ::assertTrue ($ wallet2saveOrFail ());
253+ 
254+         self ::assertSame (0 , $ wallet1balanceInt );
255+         self ::assertSame (0 , $ wallet2balanceInt );
256+ 
257+         $ transaction1$ wallet1deposit (1000 , null , true );
258+         self ::assertSame (1000 , $ wallet1balanceInt );
259+         self ::assertTrue ($ transaction1confirmed );
260+ 
261+         self ::assertFalse ($ wallet2safeResetConfirm ($ transaction1
262+         self ::assertSame (1000 , $ wallet1balanceInt );
263+         self ::assertTrue ($ transaction1confirmed );
264+     }
265+ 
201266    public  function  testWalletOwnerInvalid (): void 
202267    {
203268        $ this expectException (WalletOwnerInvalid::class);
@@ -223,6 +288,31 @@ public function testWalletOwnerInvalid(): void
223288        $ secondWalletconfirm ($ transaction
224289    }
225290
291+     public  function  testForceWalletOwnerInvalid (): void 
292+     {
293+         $ this expectException (WalletOwnerInvalid::class);
294+         $ this expectExceptionCode (ExceptionInterface::WALLET_OWNER_INVALID );
295+         $ this expectExceptionMessageStrict (trans ('wallet::errors.owner_invalid ' ));
296+ 
297+         /** 
298+          * @var Buyer $first 
299+          * @var Buyer $second 
300+          */ 
301+         [$ first$ secondtimes (2 )->create ();
302+         $ firstWallet$ firstwallet ;
303+         $ secondWallet$ secondwallet ;
304+ 
305+         self ::assertSame (0 , $ firstWalletbalanceInt );
306+ 
307+         $ transaction$ firstWalletdeposit (1000 , [
308+             'desc '  => 'unconfirmed ' ,
309+         ], false );
310+         self ::assertSame (0 , $ firstWalletbalanceInt );
311+         self ::assertFalse ($ transactionconfirmed );
312+ 
313+         $ secondWalletforceConfirm ($ transaction
314+     }
315+ 
226316    public  function  testUserConfirm (): void 
227317    {
228318        /** @var UserConfirm $userConfirm */ 
0 commit comments