Skip to content

Commit 7d45205

Browse files
committed
test: add tests for savePath timeout
1 parent 5cf6979 commit 7d45205

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/system/Session/Handlers/Database/RedisHandlerTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,28 @@ private function getInstance($options = [])
6363
return new RedisHandler($appConfig, $this->userIpAddress);
6464
}
6565

66+
public function testSavePathTimeoutFloat()
67+
{
68+
$handler = $this->getInstance(
69+
['sessionSavePath' => 'tcp://127.0.0.1:6379?timeout=2.5']
70+
);
71+
72+
$savePath = $this->getPrivateProperty($handler, 'savePath');
73+
74+
$this->assertSame(2.5, $savePath['timeout']);
75+
}
76+
77+
public function testSavePathTimeoutInt()
78+
{
79+
$handler = $this->getInstance(
80+
['sessionSavePath' => 'tcp://127.0.0.1:6379?timeout=10']
81+
);
82+
83+
$savePath = $this->getPrivateProperty($handler, 'savePath');
84+
85+
$this->assertSame(10.0, $savePath['timeout']);
86+
}
87+
6688
public function testOpen()
6789
{
6890
$handler = $this->getInstance();

0 commit comments

Comments
 (0)