123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/27
- * Time: 下午10:27
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/bonus_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/account_helper.php');
- class account_helperTest extends PHPUnit_Framework_TestCase
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public function testPayRefund()
- {
- account_helper::pay_refund(36490,500,'退款红包');
- }
- public function testModelCond()
- {
- $cur_time = time();
- $cond['usable_time'] = array(array('gt',$cur_time), array('elt',$cur_time + 200),'and');
- $cond['notify_time'] = array(array('eq',0), array('elt',$cur_time + 300),'or');
- $mod_bonus = Model('user_bonus');
- $mod_bonus->field('bonus_id,usable_time as usabletm')->where($cond)->select();
- }
- public function testCondition()
- {
- $mod_type = Model('bonus_type');
- // $condition = array('sender_id' => 36490, 'relayer_id' => 36490, '_op' => 'or');
- // $condition = array($condition,array('make_type' => 0),'_op' => 'and');
- //$condition = "(sender_id=36490 or relayer_id => 36490) and (make_type = 0)";
- $member_id = 36490;
- $cond = array();
- $cond['sender_id|repayer_id'] = array('_multi'=>true,$member_id,36491);
- $cond['make_type'] = 0;
- $mod_type->where($cond)->select();
- //$count = $mod_type->getTypeCount($condition);
- //('sender_id' = 36490 or 'relayer_id' = 36490) and ('make_type' = 0)
- }
- public static function tearDownAfterClass()
- {
- }
- }
|