Files
netslim-core/tests/Kernel/FlashServiceCoverageTest.php
2026-03-20 22:13:41 +01:00

28 lines
626 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Kernel;
use Netig\Netslim\Kernel\Http\Infrastructure\Flash\FlashService;
use PHPUnit\Framework\TestCase;
#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
final class FlashServiceCoverageTest extends TestCase
{
protected function setUp(): void
{
$_SESSION = [];
}
public function testGetCastsFalseToEmptyString(): void
{
$_SESSION['flash']['flag'] = false;
$flash = new FlashService();
self::assertSame('', $flash->get('flag'));
self::assertArrayNotHasKey('flag', $_SESSION['flash']);
}
}