bonus_helperTest.php 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. class bonus_helperTest extends PHPUnit_Framework_TestCase
  13. {
  14. public static function setUpBeforeClass()
  15. {
  16. Base::run_util();
  17. }
  18. public function testModel()
  19. {
  20. $item = Model('user_bonus')->field('*')->where(array('type_id' => 105,'bonus_id' => 2491))->select();
  21. bonus_helper::shake($item[0]['type_id'],$item[0]['bonus_id'],$item[0]['bonus_value'],3,bonus_helper::direct_dec());
  22. }
  23. public function testMemBonus()
  24. {
  25. $mem_bonus = new \bonus\witholder(36490);
  26. $mem_bonus->withold(7.30);
  27. }
  28. public static function tearDownAfterClass()
  29. {
  30. }
  31. }