Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/PaymentsMollieEuroTest.php
Show First 20 Lines • Show All 495 Lines • ▼ Show 20 Lines | public function testTopUp(): void | ||||
// Assert that email notification job has been dispatched | // Assert that email notification job has been dispatched | ||||
$this->assertSame(Payment::STATUS_PAID, $payment->status); | $this->assertSame(Payment::STATUS_PAID, $payment->status); | ||||
$this->assertEquals(2010, $wallet->fresh()->balance); | $this->assertEquals(2010, $wallet->fresh()->balance); | ||||
$transaction = $wallet->transactions() | $transaction = $wallet->transactions() | ||||
->where('type', Transaction::WALLET_CREDIT)->get()->last(); | ->where('type', Transaction::WALLET_CREDIT)->get()->last(); | ||||
$this->assertSame(2010, $transaction->amount); | $this->assertSame(2010, $transaction->amount); | ||||
$this->assertSame( | $this->assertSame( | ||||
"Auto-payment transaction {$payment->id} using Mastercard (**** **** **** 9399)", | "Auto-payment transaction {$payment->id} using Mastercard (**** **** **** 6787)", | ||||
$transaction->description | $transaction->description | ||||
); | ); | ||||
Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1); | Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1); | ||||
Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) { | Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) { | ||||
$job_payment = $this->getObjectProperty($job, 'payment'); | $job_payment = $this->getObjectProperty($job, 'payment'); | ||||
return $job_payment->id === $payment->id; | return $job_payment->id === $payment->id; | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines |