PromotionControllerTest.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. 'first_charge_template_id' => 1,
  18. 'not_first_charge_template_id' => 2
  19. ]);
  20. $res->dump();
  21. }
  22. public function testDelete()
  23. {
  24. $res = $this->withHeaders([
  25. 'Authorization' => 'Bearer '. $this->token,
  26. ])->json('post','http://localhost/api/tuiguang/promotion/delete', [
  27. 'id' => 1
  28. ]);
  29. $res->dump();
  30. }
  31. public function testupdateSeriesSequence()
  32. {
  33. $res = $this->withHeaders([
  34. 'Authorization' => 'Bearer '. $this->token,
  35. ])->json('post','http://localhost/api/tuiguang/promotion/updateSeriesSequence', [
  36. 'id' => 10,
  37. 'series_sequence' => 6,
  38. 'remark' => '',
  39. 'first_charge_template_id' => 1,
  40. 'not_first_charge_template_id' => 2,
  41. 'yinliu_enabled' => 1,
  42. 'yinliu_type' => 1,
  43. 'yinliu_gzhid' => 8,
  44. 'yinliu_sequence' => 3
  45. ]);
  46. $res->dump();
  47. }
  48. public function testList()
  49. {
  50. $res = $this->withHeaders([
  51. 'Authorization' => 'Bearer '. $this->token,
  52. ])->json('get','http://localhost/api/tuiguang/promotion/list', [
  53. 'is_config' => 1,
  54. // 'name' => 'kkk',
  55. 'id' => 10
  56. ]);
  57. $this->dumpJson($res);
  58. }
  59. public function testupdateCallbackConfig() {
  60. $res = $this->withHeaders([
  61. 'Authorization' => 'Bearer '. $this->token,
  62. ])->json('post','http://localhost/api/tuiguang/promotion/updateCallbackConfig', [
  63. 'id' => 2,
  64. 'callback_type' => 1,
  65. 'callback_config_id' => 4
  66. ]);
  67. $res->dump();
  68. }
  69. }