mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
单元测试完善
This commit is contained in:
@@ -166,6 +166,18 @@ abstract class cacheTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertFalse($cache->get('number_test'));
|
$this->assertFalse($cache->get('number_test'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取并删除缓存测试
|
||||||
|
* @return mixed
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function testPull()
|
||||||
|
{
|
||||||
|
$cache = $this->prepare();
|
||||||
|
$this->assertEquals(11, $cache->pull('number_test'));
|
||||||
|
$this->assertFalse($cache->get('number_test'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空缓存测试
|
* 清空缓存测试
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class sessionTest extends \PHPUnit_Framework_TestCase
|
|||||||
// session_status()
|
// session_status()
|
||||||
if (strstr(PHP_VERSION, 'hhvm')) {
|
if (strstr(PHP_VERSION, 'hhvm')) {
|
||||||
$this->assertEquals('', ini_get('session.auto_start'));
|
$this->assertEquals('', ini_get('session.auto_start'));
|
||||||
}else{
|
} else {
|
||||||
$this->assertEquals(0, ini_get('session.auto_start'));
|
$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']);
|
$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
|
* @covers think\Session::delete
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user