Files
fotospiel-app/tests/Feature/Marketing/MarketingLocaleRoutingTest.php
Codex Agent fa33e7cbcf Fix Event & EventType resource issues and apply formatting
- Fix EventType deletion error handling (constraint violations)
- Fix Event update error (package_id column missing)
- Fix Event Type dropdown options (JSON display issue)
- Fix EventPackagesRelationManager query error
- Add missing translations for deletion errors
- Apply Pint formatting
2026-01-21 10:34:06 +01:00

60 lines
1.6 KiB
PHP

<?php
namespace Tests\Feature\Marketing;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Inertia\Testing\AssertableInertia as Assert;
use Tests\TestCase;
class MarketingLocaleRoutingTest extends TestCase
{
use RefreshDatabase;
public function test_home_route_accepts_german_locale_prefix(): void
{
$response = $this->get('/de');
$response->assertOk();
$response->assertInertia(fn (Assert $page) => $page
->component('marketing/Home')
->where('locale', 'de')
->where('supportedLocales.0', 'de')
);
}
public function test_home_route_accepts_english_locale_prefix(): void
{
$response = $this->get('/en');
$response->assertOk();
$response->assertInertia(fn (Assert $page) => $page
->component('marketing/Home')
->where('locale', 'en')
->where('supportedLocales.1', 'en')
);
}
public function test_contact_route_respects_locale_and_component(): void
{
$response = $this->get('/en/contact');
// Debug response headers for redirect source during development
// @phpstan-ignore-next-line
// var_dump($response->headers->all());
$response->assertOk();
$response->assertInertia(fn (Assert $page) => $page
->component('marketing/Kontakt')
->where('locale', 'en')
);
$responseDe = $this->get('/de/kontakt');
$responseDe->assertOk();
$responseDe->assertInertia(fn (Assert $page) => $page
->component('marketing/Kontakt')
->where('locale', 'de')
);
}
}