12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/23
- * Time: 下午10:21
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/relation_helper.php');
- class relation_helperTest extends PHPUnit_Framework_TestCase
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public function testUpContactsA()
- {
- //36490
- $contacts = array('13911129868','13911129869','13911129870','13911129871','13911129867','15618951806','18612396521');
- relation_helper::onUpContacts(36490,'13911129867','江海苗',$contacts);
- }
- public function testUpContactsB()
- {
- //36490
- $contacts = array('13911129867','13911129869','13911129870','13911129872');
- relation_helper::onUpContacts(36511,'18612396521','秦梦洁',$contacts);
- }
- public function testOnLogin()
- {
- relation_helper::onLogin(36490);
- relation_helper::onLogin(36511);
- }
-
- public function testUpContactsC()
- {
- try
- {
- $contacts = '%5B%22178-0211-8910%22%2C%22182-6227-3057%22%2C%22189-6195-0030%22%5D';
- $contacts = session_helper::parse_contacts($contacts);
- relation_helper::onUpContacts(36511,'18612396521','秦梦洁',$contacts);
- } catch (Exception $ex) {
- echo $ex->getMessage();
- }
- }
- public function testMakeType()
- {
- $reg = '/make_type=(\d+)/i';
- $ret = preg_match($reg, '发送红包,红包单号: xxxxxx make_type=6', $arr);
- }
- }
|