PromotionControllerTest.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace Tests\Tuiguang\Http\Controllers;
  3. use Modules\Tuiguang\Http\Controllers\PromotionController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class PromotionControllerTest extends UsedTestCase
  7. {
  8. public function testAdd()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/tuiguang/promotion/add', [
  13. 'video_id' => 6,
  14. 'series_sequence' => 4,
  15. 'name' => 'kkkkddd',
  16. 'miniprogram_id' => 2,
  17. ]);
  18. $res->dump();
  19. }
  20. public function testDelete()
  21. {
  22. $res = $this->withHeaders([
  23. 'Authorization' => 'Bearer '. $this->token,
  24. ])->json('post','http://localhost/api/tuiguang/promotion/delete', [
  25. 'id' => 1
  26. ]);
  27. $res->dump();
  28. }
  29. public function testupdateSeriesSequence()
  30. {
  31. $res = $this->withHeaders([
  32. 'Authorization' => 'Bearer '. $this->token,
  33. ])->json('post','http://localhost/api/tuiguang/promotion/updateSeriesSequence', [
  34. 'id' => 2,
  35. 'series_sequence' => 5
  36. ]);
  37. $res->dump();
  38. }
  39. public function testList()
  40. {
  41. $res = $this->withHeaders([
  42. 'Authorization' => 'Bearer '. $this->token,
  43. ])->json('get','http://localhost/api/tuiguang/promotion/list', [
  44. // 'is_config' => 0,
  45. // 'name' => 'kkk'
  46. ]);
  47. // $res->dump();
  48. $this->dumpJson($res);
  49. }
  50. public function testupdateCallbackConfig() {
  51. $res = $this->withHeaders([
  52. 'Authorization' => 'Bearer '. $this->token,
  53. ])->json('post','http://localhost/api/tuiguang/promotion/updateCallbackConfig', [
  54. 'id' => 2,
  55. 'callback_type' => 1,
  56. 'callback_config_id' => 4
  57. ]);
  58. $res->dump();
  59. }
  60. }