bonus_helperTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. $url = 'http://a.lrlz.com/mobile/index.php?act=rank_list&op=index&client_type=wap&list_sn=%3Cddc6ff0cd400941d3ae0f8b0889d54a1%3E&from=timeline&isappinstalled=0';
  36. $url = urldecode($url);
  37. }
  38. public static function tearDownAfterClass()
  39. {
  40. }
  41. }