10.April 2026
This commit is contained in:
parent
a00c42e770
commit
f58c709945
208 changed files with 19280 additions and 2914 deletions
25
tests/Feature/LocalizationMiddlewareTest.php
Normal file
25
tests/Feature/LocalizationMiddlewareTest.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
uses(Tests\TestCase::class);
|
||||
|
||||
it('does not throw when session locale is a malicious string', function () {
|
||||
$response = $this->withSession(['locale' => '-1 or 5*5=25 --'])
|
||||
->get('/impressum');
|
||||
|
||||
$response->assertSuccessful();
|
||||
});
|
||||
|
||||
it('applies a valid session locale', function () {
|
||||
$response = $this->withSession(['locale' => 'en'])
|
||||
->get('/impressum');
|
||||
|
||||
$response->assertSuccessful();
|
||||
expect(app()->getLocale())->toBe('en');
|
||||
});
|
||||
|
||||
it('clears invalid session locale', function () {
|
||||
$this->withSession(['locale' => '-1 or 5*5=25 --'])
|
||||
->get('/impressum');
|
||||
|
||||
expect(session('locale'))->toBeNull();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue