diff --git a/tests/thinkphp/library/think/cache/driver/cacheTestCase.php b/tests/thinkphp/library/think/cache/driver/cacheTestCase.php index 3039024d..ec8f9b6b 100644 --- a/tests/thinkphp/library/think/cache/driver/cacheTestCase.php +++ b/tests/thinkphp/library/think/cache/driver/cacheTestCase.php @@ -166,6 +166,18 @@ abstract class cacheTestCase extends \PHPUnit_Framework_TestCase $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 diff --git a/tests/thinkphp/library/think/sessionTest.php b/tests/thinkphp/library/think/sessionTest.php index 76c18ef0..ab3e64f4 100644 --- a/tests/thinkphp/library/think/sessionTest.php +++ b/tests/thinkphp/library/think/sessionTest.php @@ -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 *