Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/WalletsTest.php
<?php | <?php | ||||
namespace Tests\Feature\Controller; | namespace Tests\Feature\Controller; | ||||
use App\Http\Controllers\API\V4\WalletsController; | use App\Http\Controllers\API\V4\WalletsController; | ||||
use App\Payment; | use App\Payment; | ||||
use App\Providers\PaymentProvider; | |||||
use App\Transaction; | use App\Transaction; | ||||
use Carbon\Carbon; | use Carbon\Carbon; | ||||
use Tests\TestCase; | use Tests\TestCase; | ||||
class WalletsTest extends TestCase | class WalletsTest extends TestCase | ||||
{ | { | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | public function testReceipts(): void | ||||
$this->assertSame(1, $json['page']); | $this->assertSame(1, $json['page']); | ||||
$this->assertSame(0, $json['count']); | $this->assertSame(0, $json['count']); | ||||
$this->assertSame(false, $json['hasMore']); | $this->assertSame(false, $json['hasMore']); | ||||
// Insert a payment to the database | // Insert a payment to the database | ||||
$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' => 'AAA1', | 'id' => 'AAA1', | ||||
'status' => PaymentProvider::STATUS_PAID, | 'status' => Payment::STATUS_PAID, | ||||
'type' => PaymentProvider::TYPE_ONEOFF, | 'type' => Payment::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, | 'credit_amount' => 1111, | ||||
'currency' => 'CHF', | 'currency' => 'CHF', | ||||
'currency_amount' => 1111, | 'currency_amount' => 1111, | ||||
]); | ]); | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |