ldc-cocotte/tests/Feature/App/Http/Controllers/Fo/Auth/RegisterControllerTest.php
2026-10-27 09:58:12 +01:00

42 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\Page;
use Database\Seeders\ContentSeeder;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\View;
describe('RegisterController', function () {
it('can access get /auth/inscription', function () {
// GIVEN
$this->seed(ContentSeeder::class);
View::share('PageList', Page::getCached()
->mapWithKeys(fn ($page) => [
$page->slug->value() => $page,
]));
Cache::flush();
// WHEN
$response = $this->get('/auth/inscription');
// THEN
$response->assertStatus(200);
});
it('can access post /auth/inscription', function () {
// GIVEN
$this->seed(ContentSeeder::class);
View::share('PageList', Page::getCached()
->mapWithKeys(fn ($page) => [
$page->slug->value() => $page,
]));
Cache::flush();
// WHEN
$response = $this->post('/auth/inscription', []);
// THEN
$response->assertStatus(302);
});
});