12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace Tests\Audience\Http\Controllers;
- use Modules\Audience\Http\Controllers\UserGroupController;
- use PHPUnit\Framework\TestCase;
- use Tests\UsedTestCase;
- class UserGroupControllerTest extends UsedTestCase
- {
- public function testAdd()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/audienceManage/userGroup/add', [
- 'name' => uniqid('liuzj-test-'),
- 'gzh_ids' => [6,8],
- 'tags' => [
- 'attention_hour' => '0-6',
- 'in_48_hour' => 1,
- 'interact_hour' => '0-6',
- ],
- 'remark' => uniqid('', true)
- ]);
- $this->dumpJson($res);
- }
- public function testDetail()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/audienceManage/userGroup/detail', [
- 'id' => 1
- ]);
- $this->dumpJson($res);
- }
- public function testlist()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/audienceManage/userGroup/list', [
- 'name' => '207'
- ]);
- $this->dumpJson($res);
- }
- public function testDelete()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/audienceManage/userGroup/delete', [
- 'id' => 1
- ]);
- $this->dumpJson($res);
- }
- public function testlistUser()
- {
- $timestamp = time();
- $signKey = config('audience.ug.signKey');
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/audienceManage/outUserGroup/listUser', [
- 'timestamp' => $timestamp,
- 'sign' => md5($signKey. $timestamp),
- 'gzhId' => 8,
- 'ugId' => 2,
- 'nextUid' => 100,
- 'limit' => 10
- ]);
- $this->dumpJson($res);
- }
- }
|