You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
615 B
30 lines
615 B
<?php |
|
|
|
namespace yiiunit\framework\web; |
|
|
|
use yii\web\Session; |
|
use yiiunit\TestCase; |
|
|
|
/** |
|
* @group web |
|
*/ |
|
class SessionTest extends TestCase |
|
{ |
|
/** |
|
* Test to prove that after Session::destroy session id set to old value |
|
*/ |
|
public function testDestroySessionId() |
|
{ |
|
$session = new Session(); |
|
$session->open(); |
|
$oldSessionId = @session_id(); |
|
|
|
$this->assertNotEmpty($oldSessionId); |
|
|
|
$session->destroy(); |
|
|
|
$newSessionId = @session_id(); |
|
$this->assertNotEmpty($newSessionId); |
|
$this->assertEquals($oldSessionId, $newSessionId); |
|
} |
|
}
|
|
|