Working state

This commit is contained in:
julien
2026-03-16 09:25:44 +01:00
parent b5a728e669
commit fd3f608059
24 changed files with 249 additions and 502 deletions

View File

@@ -7,6 +7,7 @@ use App\Shared\Http\FlashService;
use PHPUnit\Framework\TestCase;
#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
final class FlashServiceTest extends TestCase
{
protected function setUp(): void
@@ -34,26 +35,6 @@ final class FlashServiceTest extends TestCase
self::assertArrayNotHasKey('count', $_SESSION['flash']);
}
public function testGetCastsBooleanFalseToEmptyStringAndRemovesIt(): void
{
$_SESSION['flash']['flag'] = false;
$flash = new FlashService();
self::assertSame('', $flash->get('flag'));
self::assertArrayNotHasKey('flag', $_SESSION['flash']);
}
public function testSetOverridesPreviousMessageForSameKey(): void
{
$flash = new FlashService();
$flash->set('notice', 'Premier');
$flash->set('notice', 'Second');
self::assertSame('Second', $flash->get('notice'));
}
public function testGetReturnsNullWhenMissing(): void
{
$flash = new FlashService();