UserGroupControllerTest.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Tests\Audience\Http\Controllers;
  3. use Modules\Audience\Http\Controllers\UserGroupController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class UserGroupControllerTest extends UsedTestCase
  7. {
  8. public function testAdd()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/audienceManage/userGroup/add', [
  13. 'name' => uniqid('liuzj-test-'),
  14. 'gzh_ids' => [6,8],
  15. 'tags' => [
  16. 'attention_hour' => '0-6',
  17. 'in_48_hour' => 1,
  18. 'interact_hour' => '0-6',
  19. ],
  20. 'remark' => uniqid('', true)
  21. ]);
  22. $this->dumpJson($res);
  23. }
  24. public function testDetail()
  25. {
  26. $res = $this->withHeaders([
  27. 'Authorization' => 'Bearer '. $this->token,
  28. ])->json('get','http://localhost/api/audienceManage/userGroup/detail', [
  29. 'id' => 1
  30. ]);
  31. $this->dumpJson($res);
  32. }
  33. public function testlist()
  34. {
  35. $res = $this->withHeaders([
  36. 'Authorization' => 'Bearer '. $this->token,
  37. ])->json('get','http://localhost/api/audienceManage/userGroup/list', [
  38. 'name' => '207'
  39. ]);
  40. $this->dumpJson($res);
  41. }
  42. public function testDelete()
  43. {
  44. $res = $this->withHeaders([
  45. 'Authorization' => 'Bearer '. $this->token,
  46. ])->json('get','http://localhost/api/audienceManage/userGroup/delete', [
  47. 'id' => 1
  48. ]);
  49. $this->dumpJson($res);
  50. }
  51. }