27 lines
594 B
PHP
27 lines
594 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Shared;
|
|
|
|
use App\Shared\Http\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']);
|
|
}
|
|
}
|