2, 'cash' => 200000000, 'note' => 'برداشت ریالی', ]); $this->assertSame(1, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw)); } public function test_admin_deposit_with_positive_cash_is_direction_zero(): void { $withdraw = new Withdraw([ 'type' => null, 'cash' => 200000000, 'note' => 'افزایش موجودی', ]); $this->assertSame(0, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw)); } public function test_admin_deduction_with_negative_cash_is_direction_one(): void { $withdraw = new Withdraw([ 'cash' => -50000000, 'note' => 'کسر', ]); $this->assertSame(1, app(ZarinSyncService::class)->rialWalletDirectionFromWithdraw($withdraw)); } public function test_desc_bardasht_is_withdraw_and_variz_is_deposit(): void { $svc = app(ZarinSyncService::class); $this->assertSame(1, $svc->rialWalletDirectionFromDesc('برداشت وجه')); $this->assertSame(0, $svc->rialWalletDirectionFromDesc('واریز وجه')); $this->assertSame(0, $svc->rialWalletDirectionFromDesc('واریز — افزایش موجودی')); } }