AdvertiserControllerTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Tests\Channel\Http\Controllers;
  3. use Modules\Channel\Http\Controllers\AdvertiserController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class AdvertiserControllerTest extends UsedTestCase
  7. {
  8. public function testAddAdvertiser()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/channel/advertiser/add', [
  13. 'email' => 'aa1@test.com',
  14. 'password' => '123',
  15. 'repassword' => '123',
  16. 'status' => 1,
  17. 'remark' => 'kljlkjkj',
  18. 'miniProgramIds'=> [1,2,3],
  19. 'username' => 'aa1@test'
  20. ]);
  21. $res->dump();
  22. }
  23. public function testlistAdvertiser() {
  24. $res = $this->withHeaders([
  25. 'Authorization' => 'Bearer '. $this->token,
  26. ])->json('get','http://localhost/api/channel/advertiser/listAdvertiser?'.http_build_query([
  27. // 'email' => 'aa1@test.com',
  28. // 'miniProgramId' => 3,
  29. 'username' => 'aa'
  30. ]));
  31. $res->dump();
  32. }
  33. public function testgetAdvertiser() {
  34. $res = $this->withHeaders([
  35. 'Authorization' => 'Bearer '. $this->token,
  36. ])->json('get','http://localhost/api/channel/advertiser/getAdvertiser?'.http_build_query([
  37. // 'email' => 'aa1@test.com',
  38. // 'miniProgramId' => 3,
  39. 'username' => 'aa'
  40. ]));
  41. $res->dump();
  42. }
  43. }