You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
1.2 KiB

  1. <?php
  2. /**
  3. * PhpUnderControl_PhalApiCacheNone_Test
  4. *
  5. * 针对 ../../PhalApi/Cache/None.php PhalApi_Cache_None 类的PHPUnit单元测试
  6. *
  7. * @author: dogstar 20150226
  8. */
  9. require_once dirname(__FILE__) . '/../test_env.php';
  10. if (!class_exists('PhalApi_Cache_None')) {
  11. require dirname(__FILE__) . '/../../PhalApi/Cache/None.php';
  12. }
  13. class PhpUnderControl_PhalApiCacheNone_Test extends PHPUnit_Framework_TestCase
  14. {
  15. public $phalApiCacheNone;
  16. protected function setUp()
  17. {
  18. parent::setUp();
  19. $this->phalApiCacheNone = new PhalApi_Cache_None();
  20. }
  21. protected function tearDown()
  22. {
  23. }
  24. /**
  25. * @group testSet
  26. */
  27. public function testSet()
  28. {
  29. $key = 'aKey';
  30. $value = 'aValue';
  31. $expire = '100';
  32. $rs = $this->phalApiCacheNone->set($key, $value, $expire);
  33. }
  34. /**
  35. * @group testGet
  36. */
  37. public function testGet()
  38. {
  39. $key = 'aKey';
  40. $rs = $this->phalApiCacheNone->get($key);
  41. $this->assertNull($rs);
  42. }
  43. /**
  44. * @group testDelete
  45. */
  46. public function testDelete()
  47. {
  48. $key = 'aKey';
  49. $rs = $this->phalApiCacheNone->delete($key);
  50. }
  51. }