first commit
This commit is contained in:
26
tests/Shared/FlashServiceConsumeTest.php
Normal file
26
tests/Shared/FlashServiceConsumeTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Shared;
|
||||
|
||||
use App\Shared\Http\FlashService;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user