Base.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace tests;
  3. use PHPUnit\Framework\TestCase;
  4. use Easemob\Auth;
  5. use Easemob\User;
  6. use Easemob\Contact;
  7. use Easemob\Block;
  8. use Easemob\Message;
  9. use Easemob\UserMetadata;
  10. use Easemob\Push;
  11. use Easemob\Attachment;
  12. use Easemob\Group;
  13. use Easemob\Room;
  14. class Base extends TestCase
  15. {
  16. public $auth;
  17. public $user;
  18. public $contact;
  19. public $block;
  20. public $message;
  21. public $metadata;
  22. public $push;
  23. public $attachment;
  24. public $group;
  25. public $room;
  26. public function __construct()
  27. {
  28. parent::__construct();
  29. $this->auth = new Auth("appKey", "Client ID", "ClientSecret");
  30. // 设置 Rest Api 域名
  31. // $this->auth->setApiUri('http://a1-hsb.easemob.com');
  32. $this->user = new User($this->auth);
  33. $this->contact = new Contact($this->auth);
  34. $this->block = new Block($this->auth);
  35. $this->message = new Message($this->auth);
  36. $this->metadata = new UserMetadata($this->auth);
  37. $this->push = new Push($this->auth);
  38. $this->attachment = new Attachment($this->auth);
  39. $this->group = new Group($this->auth);
  40. $this->room = new Room($this->auth);
  41. }
  42. }