PromotionControllerTest.php 2.1 KB

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