redisTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 2016/12/24
  6. * Time: 下午3:58
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once (BASE_ROOT_PATH . '/fooder.php');
  10. require_once (BASE_ROOT_PATH . '/helper/util_helper.php');
  11. class redisTest extends PHPUnit_Framework_TestCase
  12. {
  13. public static function setUpBeforeClass()
  14. {
  15. Base::run_util();
  16. }
  17. public function testIncr()
  18. {
  19. for ($i = 0; $i < 300; ++$i) {
  20. $x = util::mem_no();
  21. printf("%d \r\n",$x);
  22. }
  23. }
  24. public function testMember()
  25. {
  26. $mod = Model('member');
  27. $mobile = $mod->getMemberInfoByID(36490,'member_no');
  28. }
  29. public function testGetgid()
  30. {
  31. $url = 'http://images.shobserver.com/news/news/2016/12/24/0370ef86-7cea-4094-bfd4-2d6a284f8bf8.jpg?goods_id=3000';
  32. $exp = '/goods_id=(\d{1,9})$/';
  33. $x = preg_match_all($exp, $url, $match);
  34. }
  35. public static function tearDownAfterClass()
  36. {
  37. }
  38. }