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.
|
|
|
<?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);
|
|
|
|
}
|
|
|
|
}
|