Fix Invalid data in Session (#241)

Signed-off-by: Volodymyr Panivko <sveneld300@gmail.com>
This commit is contained in:
Volodymyr Panivko 2026-02-11 20:35:41 +01:00 • committed by GitHub
commit 8f8af90007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,4 +33,18 @@ class SessionTest extends TestCase
$result = $session->all();
$this->assertEquals(['foo' => 'bar'], $result);
}
public function testAllReturnsEmptyArrayForNullPayload()
{
$store = $this->getMockBuilder(InMemorySessionStore::class)
->disableOriginalConstructor()
->onlyMethods(['read'])
->getMock();
$store->expects($this->once())->method('read')->willReturn('null');
$session = new Session($store);
$result = $session->all();
$this->assertSame([], $result);
}
}