relation_helperTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. }