Add LetterSendAction

This commit is contained in:
philipp lang 2022-11-09 01:33:31 +01:00
parent 2150139abf
commit 74c711d75c
3 changed files with 5 additions and 4 deletions

View File

@ -2,6 +2,7 @@
namespace App\Console;
use App\Letter\Actions\LetterSendAction;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@ -13,6 +14,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
LetterSendAction::class,
];
/**

View File

@ -16,10 +16,8 @@ class LetterSendAction
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'payment:send';
public string $commandSignature = 'letter:send';
/**
* The console command description.

View File

@ -8,6 +8,7 @@ use App\Member\Member;
use App\Payment\Payment;
use App\Payment\PaymentMail;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Storage;
use Mail;
use Tests\TestCase;
@ -37,7 +38,7 @@ class LetterSendActionTest extends TestCase
{
Mail::fake();
app(LetterSendAction::class)->handle();
Artisan::call('letter:send');
Mail::assertSent(PaymentMail::class, fn ($mail) => Storage::path('rechnung-fur-mom.pdf') === $mail->filename);
}