单元测试完善

This commit is contained in:
thinkphp
2016-09-14 17:07:49 +08:00
parent e37f5aee16
commit c38e235f03
2 changed files with 21 additions and 1 deletions

View File

@@ -124,7 +124,7 @@ class sessionTest extends \PHPUnit_Framework_TestCase
// session_status()
if (strstr(PHP_VERSION, 'hhvm')) {
$this->assertEquals('', ini_get('session.auto_start'));
}else{
} else {
$this->assertEquals(0, ini_get('session.auto_start'));
}
@@ -213,6 +213,14 @@ class sessionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(Session::get('sessionnamegetarrper.subname', 'think_'), $_SESSION['think_']['sessionnamegetarrper']['subname']);
}
public function testPull()
{
Session::prefix(null);
Session::set('sessionnamedel', 'sessionvalue');
$this->assertEquals('sessionvalue', Session::pull('sessionnameget'));
$this->assertNull(Session::get('sessionnameget'));
}
/**
* @covers think\Session::delete
*