mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 22:30:27 +08:00
31 lines
615 B
PHP
31 lines
615 B
PHP
<?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);
|
|
}
|
|
}
|