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

30 lines
689 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 FlashServiceConsumeTest extends TestCase
{
protected function setUp(): void
{
$_SESSION = [];
}
public function testGetReturnsNullWhenMissingAndConsumesWhenPresent(): void
{
$flash = new FlashService();
self::assertNull($flash->get('missing'));
$flash->set('notice', 'Bonjour');
self::assertSame('Bonjour', $flash->get('notice'));
self::assertNull($flash->get('notice'));
}
}