Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Jobs/WalletCheckTest.php
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | public function testHandleInitial(): void | ||||
// Assert the mail was sent to the user's email, but not to his external email | // Assert the mail was sent to the user's email, but not to his external email | ||||
Mail::assertSent(\App\Mail\NegativeBalance::class, 1); | Mail::assertSent(\App\Mail\NegativeBalance::class, 1); | ||||
Mail::assertSent(\App\Mail\NegativeBalance::class, function ($mail) use ($user) { | Mail::assertSent(\App\Mail\NegativeBalance::class, function ($mail) use ($user) { | ||||
return $mail->hasTo($user->email) && !$mail->hasCc('external@test.com'); | return $mail->hasTo($user->email) && !$mail->hasCc('external@test.com'); | ||||
}); | }); | ||||
$wallet->refresh(); | $wallet->refresh(); | ||||
$today_regexp = '/' . Carbon::now()->toDateString() . ' [0-9]{2}:[0-9]{2}:[0-9]{2}/'; | $today_regexp = '/' . Carbon::now()->toDateString() . ' [0-9]{2}:[0-9]{2}:[0-9]{2}/'; | ||||
$this->assertRegExp($today_regexp, $wallet->getSetting('balance_negative_since')); | $this->assertMatchesRegularExpression($today_regexp, $wallet->getSetting('balance_negative_since')); | ||||
$this->assertRegExp($today_regexp, $wallet->getSetting('balance_warning_initial')); | $this->assertMatchesRegularExpression($today_regexp, $wallet->getSetting('balance_warning_initial')); | ||||
} | } | ||||
/** | /** | ||||
* Test job handle, top-up before reminder notification | * Test job handle, top-up before reminder notification | ||||
* | * | ||||
* @depends testHandleInitial | * @depends testHandleInitial | ||||
*/ | */ | ||||
public function testHandleBeforeReminder(): void | public function testHandleBeforeReminder(): void | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |