Files
tehnobox/tests/Feature/LocaleSwitchingTest.php
ssww23 0ee9f05416
Some checks failed
Deploy / deploy (push) Has been cancelled
1
2026-03-17 01:59:00 +03:00

38 lines
1010 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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();
}
}