TestFcode.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 2017/4/6
  6. * Time: 下午2:42
  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/fcode/generator.php');
  11. require_once(BASE_ROOT_PATH . '/helper/fcode/operator.php');
  12. require_once(BASE_ROOT_PATH . '/helper/fcode/mfcode.php');
  13. require_once(BASE_ROOT_PATH . '/helper/fcode/present_manager.php');
  14. require_once(BASE_ROOT_PATH . '/helper/fcode/send_manager.php');
  15. class TestFcode extends PHPUnit_Framework_TestCase
  16. {
  17. public static function setUpBeforeClass()
  18. {
  19. Base::run_util();
  20. }
  21. public function testManager()
  22. {
  23. $manager = fcode\present_manager::instance();
  24. }
  25. public function testSendManager()
  26. {
  27. $manager = fcode\send_manager::instance();
  28. $manager->fetch_normal(600,1);
  29. }
  30. public function testGenerate()
  31. {
  32. $gen = new fcode\generator(24,10,'HSDX01',10);
  33. $url = $gen->make();
  34. }
  35. public function testGrab()
  36. {
  37. $oper = new fcode\operator(24,0);
  38. $fcode = $oper->grab();
  39. }
  40. public function testPrefix()
  41. {
  42. $mod_fcode = Model('goods_fcode');
  43. $result = $mod_fcode->where(array('fc_code' => 'NWY818729'))->find();
  44. $fcode = new fcode\mfcode('NWY818729');
  45. $code = sprintf("%06s",'DLHS');
  46. }
  47. public function testString()
  48. {
  49. $num = "30";
  50. for($i = 0; $i < $num; ++$i) {
  51. $data = $i;
  52. }
  53. }
  54. }