[Server] Stop Session::forget() from creating missing segments (#484)
This commit is contained in:
parent
418034f2b0
commit
4630d7424e
1 changed files with 17 additions and 5 deletions
|
|
@ -245,6 +245,21 @@ class SessionTest extends TestCase
|
|||
$this->assertFalse($this->session->has('nonexistent'));
|
||||
}
|
||||
|
||||
public function testForgetDoesNotCreateIntermediateSegments(): void
|
||||
{
|
||||
$this->session->forget('a.b');
|
||||
|
||||
$this->assertSame([], $this->session->all());
|
||||
}
|
||||
|
||||
public function testForgetDoesNotOverwriteNonArrayIntermediateValue(): void
|
||||
{
|
||||
$this->session->set('key', 'string_value');
|
||||
$this->session->forget('key.nested');
|
||||
|
||||
$this->assertSame('string_value', $this->session->get('key'));
|
||||
}
|
||||
|
||||
public function testSessionCanStoreVariousDataTypes(): void
|
||||
{
|
||||
$this->session->set('string', 'value');
|
||||
|
|
|
|||
Loading…
Reference in a new issue