Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If session can not be opened, destroy first (#67)
- Loading branch information
Showing
6 changed files
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
namespace Gt\Session; | ||
|
||
use Gt\Session\Test\Helper\FunctionMocker; | ||
|
||
function session_destroy() { | ||
if(FunctionMocker::$callState["session_start__fail"]) { | ||
unset(FunctionMocker::$callState["session_start__fail"]); | ||
} | ||
|
||
FunctionMocker::$mockCalls["session_destroy"] []= func_get_args(); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
namespace Gt\Session; | ||
|
||
use Gt\Session\Test\Helper\FunctionMocker; | ||
|
||
function session_start() { | ||
\Gt\Session\Test\Helper\FunctionMocker::$mockCalls["session_start"] []= func_get_args(); | ||
FunctionMocker::$mockCalls["session_start"] []= func_get_args(); | ||
|
||
if(FunctionMocker::$callState["session_start__fail"]) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters