|
@ -8,6 +8,7 @@ |
|
|
* @since 2011-10-25 |
|
|
* @since 2011-10-25 |
|
|
* |
|
|
* |
|
|
* Unit tests for Session class |
|
|
* Unit tests for Session class |
|
|
|
|
|
* @TODO: Session::destroy() - check if session was started |
|
|
* @TODO: Session::destroy() - uncheck started flag after destroy |
|
|
* @TODO: Session::destroy() - uncheck started flag after destroy |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
@ -24,7 +25,10 @@ class SessionTest extends PHPUnit_Framework_TestCase |
|
|
$this->started = $class->getProperty('started'); |
|
|
$this->started = $class->getProperty('started'); |
|
|
$this->started->setAccessible(true); |
|
|
$this->started->setAccessible(true); |
|
|
Session::start(); |
|
|
Session::start(); |
|
|
Session::destroy(); |
|
|
|
|
|
|
|
|
$sid = Session::getId(); |
|
|
|
|
|
if (!empty($sid)) { |
|
|
|
|
|
Session::destroy(); |
|
|
|
|
|
} |
|
|
$this->started->setValue(null, false); |
|
|
$this->started->setValue(null, false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -157,10 +161,27 @@ class SessionTest extends PHPUnit_Framework_TestCase |
|
|
|
|
|
|
|
|
class Handler |
|
|
class Handler |
|
|
{ |
|
|
{ |
|
|
public static function open(){} |
|
|
|
|
|
public static function close(){} |
|
|
|
|
|
public static function read(){} |
|
|
|
|
|
public static function write(){} |
|
|
|
|
|
public static function destroy(){} |
|
|
|
|
|
public static function gc(){} |
|
|
|
|
|
|
|
|
public static function open() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function close() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function read() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function write() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function destroy() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function gc() |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
} |
|
|
} |