123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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');
- require_once(BASE_ROOT_PATH . '/helper/category_helper.php');
- class bar
- {
- public function __construct()
- {
- echo __FUNCTION__ . " \n";
- }
- public function __destruct()
- {
- echo __FUNCTION__ . " \n";
- }
- }
- 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');
- $X= $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();
- }
- private function xxx()
- {
- $bar = new bar();
- }
- public function testDestruct()
- {
- echo __FUNCTION__ . " begin \n";
- $this->xxx();
- $bar = new bar();
- echo __FUNCTION__ . " end \n";
- }
- public function testBrands()
- {
- $brands = brand_helper::brandex();
- }
- public static function tearDownAfterClass()
- {
- }
- }
|