<?php
/**
 * Created by PhpStorm.
 * User: stanley-king
 * Date: 2017/11/14
 * Time: 下午7:44
 */

define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
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 PHPUnit_Framework_TestCase
{
    public static function setUpBeforeClass()
    {
        Base::run_util();
    }

    public function testRegister()
    {
        $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);

        }
    }
}
