Skip to content

Commit 57b6dbd

Browse files
Majkl578dg
authored andcommitted
tests: fixes session handler test [Closes #22]
1 parent 9583852 commit 57b6dbd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/Http/Session.handler.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ class MySessionStorage extends Object implements SessionHandlerInterface
2020
function open($savePath, $sessionName)
2121
{
2222
$this->path = $savePath;
23+
return TRUE;
2324
}
2425

2526
function close()
2627
{
28+
return TRUE;
2729
}
2830

2931
function read($id)
3032
{
31-
return @file_get_contents("$this->path/sess_$id");
33+
return (string) @file_get_contents("$this->path/sess_$id");
3234
}
3335

3436
function write($id, $data)
@@ -38,7 +40,7 @@ class MySessionStorage extends Object implements SessionHandlerInterface
3840

3941
function destroy($id)
4042
{
41-
return @unlink("$this->path/sess_$id");
43+
return !is_file("$this->path/sess_$id") || @unlink("$this->path/sess_$id");
4244
}
4345

4446
function gc($maxlifetime)

0 commit comments

Comments
 (0)