1
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
ssww23
2026-03-17 01:59:00 +03:00
parent 93a655235a
commit 0ee9f05416
48 changed files with 1193 additions and 413 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
class LocaleSwitchingTest extends TestCase
{
public function test_site_uses_russian_by_default(): void
{
$response = $this->get('/about');
$response->assertOk();
$response->assertSee('lang="ru"', false);
$response->assertSee('pc-lang-switcher-label">Рус<', false);
}
public function test_user_can_switch_site_locale_to_kazakh(): void
{
$response = $this->from('/about')->post('/locale/kk');
$response->assertRedirect('/about');
$response->assertSessionHas('locale', 'kk');
$this->withSession(['locale' => 'kk'])
->get('/about')
->assertOk()
->assertSee('lang="kk"', false)
->assertSee('pc-lang-switcher-label">Қаз<', false)
->assertSee('Басты бет');
}
public function test_unsupported_locale_returns_not_found(): void
{
$this->post('/locale/en')->assertNotFound();
}
}