bonus_helperTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/6/21
  6. * Time: 下午8:28
  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/bonus_helper.php');
  11. require_once(BASE_ROOT_PATH . '/helper/bonus/witholder.php');
  12. require_once(BASE_ROOT_PATH . '/helper/notify_helper.php');
  13. class bonus_helperTest extends PHPUnit_Framework_TestCase
  14. {
  15. public static function setUpBeforeClass()
  16. {
  17. Base::run_util();
  18. }
  19. public function testModel()
  20. {
  21. $item = Model('user_bonus')->field('*')->where(array('type_id' => 105,'bonus_id' => 2491))->select();
  22. bonus_helper::shake($item[0]['type_id'],$item[0]['bonus_id'],$item[0]['bonus_value'],3,bonus_helper::direct_dec());
  23. }
  24. public function testMemBonus()
  25. {
  26. $mem_bonus = new \bonus\witholder(36490);
  27. $mem_bonus->withold(7.30);
  28. }
  29. public function testExpire()
  30. {
  31. notify_helper::bonus_expired();
  32. }
  33. public function testPush()
  34. {
  35. }
  36. public static function tearDownAfterClass()
  37. {
  38. }
  39. }