12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/11/14
- * Time: 下午7:44
- */
- use PHPUnit\Framework\TestCase;
- /**
- * 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 . '/global.php');
- require_once(BASE_CORE_PATH . '/lrlz.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/stat_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/sms_helper.php');
- class TestSms extends TestCase
- {
- public static function setUpBeforeClass() : void
- {
- Base::run_util();
- }
- public function testRegister()
- {
- $mobile = '13911129867';
- $sms = new sms_helper();
- $ret = $sms->send_code($mobile, sms_helper::register,false);
- }
- public function testEvidence(){
- // $type = 'balance_warning';
- // $ret = QueueClient::push('sendSMS', ['mobile'=>17801048874,'type'=>$type,'datas' => [date("m月d日H时") , 500]]);
- // $type = 'evidence';
- // $ret = QueueClient::push('sendSMS', ['mobile'=>17801048874,'type'=>$type,'datas' => [date("m月d日H时") , 'yezi' , 500]]);
- $merchants = Model('merchant')->getMerchantList([],'','','merchant.*,member.available_predeposit');
- foreach ($merchants as $merchant){
- if(($merchant['available_predeposit'] < $merchant['alarm_amount'] && !empty($merchant['contact_phone']))|| $merchant['available_predeposit'] < 10000)
- {
- QueueClient::push('sendSMS', ['mobile'=>$merchant['contact_phone'],'type'=>'balance_warning','datas' => [date("m月d日H时") , $merchant['available_predeposit']]]);
- }
- }
- }
- public function testInvitee()
- {
- $sms = new Sms();
- $mobile = '13911129867';
- //$params[Sms::tpl_reg_user_bonus] = ['amount' => 1.0];
- //$params[Sms::tpl_reg_inviter] = ['user_name' => '张莉','level' => 1,'amount' => 5];
- $params[Sms::tpl_reg_invitee] = ['user_name' => '张莉','inviter_name' => "桑贵苏",'level' => 3,'amount' => 2];
- $params[Sms::tpl_order_complete_inviter] = ['level' => 1,'name' => '桑贵苏','amount' => 2];
- $params[Sms::tpl_order_complete_invitee] = ['name' => '桑贵苏','amount' => 2];
- foreach ($params as $sms_type => $sms_param) {
- $status = $sms->send_oper($mobile,$sms_type,$sms_param);
- }
- }
- public function testOrderSms()
- {
- $pay_sn = 570510757490858481;
- $order = new async\order($pay_sn);
- $logistics_no = 10000;
- $logistics_company = "顺丰";
- $order->onSended($logistics_no,$logistics_company);
- echo 0;
- }
- }
|