adrema/tests/Feature/Pdf/EfzTest.php

24 lines
641 B
PHP
Raw Normal View History

2022-03-20 16:33:56 +01:00
<?php
namespace Tests\Feature\Pdf;
use App\Member\Member;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class EfzTest extends TestCase
{
use DatabaseTransactions;
public function testItCreatesAEfzPdfFile(): void
{
2022-08-30 23:43:54 +02:00
$this->withoutExceptionHandling()->login()->withNamiSettings();
2022-03-20 16:33:56 +01:00
$member = Member::factory()->defaults()->create(['firstname' => 'Max', 'lastname' => 'Muster']);
$response = $this->get("/member/{$member->id}/efz");
$response->assertOk();
$response->assertHeader('Content-Disposition', 'inline; filename="efz-fuer-max-muster.pdf"');
}
}