relation_helperTest.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/6/23
  6. * Time: 下午10:21
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once(BASE_ROOT_PATH . '/fooder.php');
  10. require_once(BASE_ROOT_PATH . '/helper/relation_helper.php');
  11. class relation_helperTest extends PHPUnit_Framework_TestCase
  12. {
  13. public static function setUpBeforeClass()
  14. {
  15. Base::run_util();
  16. }
  17. public function testUpContactsA()
  18. {
  19. //36490
  20. $contacts = array('13911129868','13911129869','13911129870','13911129871','13911129867','15618951806','18612396521');
  21. relation_helper::onUpContacts(36490,'13911129867','江海苗',$contacts);
  22. }
  23. public function testUpContactsB()
  24. {
  25. //36490
  26. $contacts = array('13911129867','13911129869','13911129870','13911129872');
  27. relation_helper::onUpContacts(36511,'18612396521','秦梦洁',$contacts);
  28. }
  29. public function testOnLogin()
  30. {
  31. relation_helper::onLogin(36490);
  32. relation_helper::onLogin(36511);
  33. }
  34. public function testUpContactsC()
  35. {
  36. try
  37. {
  38. $contacts = '%5B%22178-0211-8910%22%2C%22182-6227-3057%22%2C%22189-6195-0030%22%5D';
  39. $contacts = session_helper::parse_contacts($contacts);
  40. relation_helper::onUpContacts(36511,'18612396521','秦梦洁',$contacts);
  41. } catch (Exception $ex) {
  42. echo $ex->getMessage();
  43. }
  44. }
  45. public function testMakeType()
  46. {
  47. $reg = '/make_type=(\d+)/i';
  48. $ret = preg_match($reg, '发送红包,红包单号: xxxxxx make_type=6', $arr);
  49. }
  50. public function testFollower()
  51. {
  52. $follower = relation_helper::follower(36490);
  53. if(!empty($follower)) {
  54. //$follower = self::separate_page($follower,$pages);
  55. $members = Model('member')->field('*')->where(array('member_id' => array('in',$follower)))->limit(false)->select();
  56. $desc = array();
  57. foreach ($members as $val) {
  58. $info = new member_info($val);
  59. }
  60. //return self::outsuccess(array('followers' => $follower,'mem_desc' => , 'mobile_page' => mobile_page($pages)));
  61. }
  62. }
  63. public function testDate()
  64. {
  65. $title = strftime("熊猫美妆%m月%d日红包风云榜",1469030400);
  66. }
  67. }