PromotionControllerTest.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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' => 136,
  35. 'series_sequence' => 5,
  36. 'remark' => '',
  37. 'first_charge_template_id' => 1,
  38. 'not_first_charge_template_id' => 2
  39. ]);
  40. $res->dump();
  41. }
  42. public function testList()
  43. {
  44. $res = $this->withHeaders([
  45. 'Authorization' => 'Bearer '. $this->token,
  46. ])->json('get','http://localhost/api/tuiguang/promotion/list', [
  47. // 'is_config' => 0,
  48. // 'name' => 'kkk'
  49. ]);
  50. $res->dump();
  51. // $this->dumpJson($res);
  52. }
  53. public function testupdateCallbackConfig() {
  54. $res = $this->withHeaders([
  55. 'Authorization' => 'Bearer '. $this->token,
  56. ])->json('post','http://localhost/api/tuiguang/promotion/updateCallbackConfig', [
  57. 'id' => 2,
  58. 'callback_type' => 1,
  59. 'callback_config_id' => 4
  60. ]);
  61. $res->dump();
  62. }
  63. }