Files
yii2/tests/framework/web/session/SessionTest.php
2017-10-31 12:50:37 +03:00

36 lines
769 B
PHP

<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\web\session;
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);
}
}