Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/WalletTest.php
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | public function testReceipts(): void | ||||
$payment = Payment::create([ | $payment = Payment::create([ | ||||
'id' => 'AAA1', | 'id' => 'AAA1', | ||||
'status' => PaymentProvider::STATUS_PAID, | 'status' => PaymentProvider::STATUS_PAID, | ||||
'type' => PaymentProvider::TYPE_ONEOFF, | 'type' => PaymentProvider::TYPE_ONEOFF, | ||||
'description' => 'Paid in March', | 'description' => 'Paid in March', | ||||
'wallet_id' => $wallet->id, | 'wallet_id' => $wallet->id, | ||||
'provider' => 'stripe', | 'provider' => 'stripe', | ||||
'amount' => 1111, | 'amount' => 1111, | ||||
'credit_amount' => 1111, | |||||
'currency_amount' => 1111, | 'currency_amount' => 1111, | ||||
'currency' => 'CHF', | 'currency' => 'CHF', | ||||
]); | ]); | ||||
$payment->updated_at = $date; | $payment->updated_at = $date; | ||||
$payment->save(); | $payment->save(); | ||||
$receipts[] = $date->format('Y-m'); | $receipts[] = $date->format('Y-m'); | ||||
$date = Carbon::create(intval(date('Y')) - 1, 4, 30); | $date = Carbon::create(intval(date('Y')) - 1, 4, 30); | ||||
$payment = Payment::create([ | $payment = Payment::create([ | ||||
'id' => 'AAA2', | 'id' => 'AAA2', | ||||
'status' => PaymentProvider::STATUS_PAID, | 'status' => PaymentProvider::STATUS_PAID, | ||||
'type' => PaymentProvider::TYPE_ONEOFF, | 'type' => PaymentProvider::TYPE_ONEOFF, | ||||
'description' => 'Paid in April', | 'description' => 'Paid in April', | ||||
'wallet_id' => $wallet->id, | 'wallet_id' => $wallet->id, | ||||
'provider' => 'stripe', | 'provider' => 'stripe', | ||||
'amount' => 1111, | 'amount' => 1111, | ||||
'credit_amount' => 1111, | |||||
'currency_amount' => 1111, | 'currency_amount' => 1111, | ||||
'currency' => 'CHF', | 'currency' => 'CHF', | ||||
]); | ]); | ||||
$payment->updated_at = $date; | $payment->updated_at = $date; | ||||
$payment->save(); | $payment->save(); | ||||
$receipts[] = $date->format('Y-m'); | $receipts[] = $date->format('Y-m'); | ||||
// Assert Receipts tab with receipts available | // Assert Receipts tab with receipts available | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |