VideoControllerTest.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace Tests\Video\Http\Controllers;
  3. use Modules\Video\Http\Controllers\JuliangAccountController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class VideoControllerTest extends UsedTestCase
  7. {
  8. public function testAdd()
  9. {
  10. $data = [
  11. 'name' => 'test1-112',
  12. 'total_episode_num' => 10,
  13. 'update_type' => 1,
  14. 'category_id' => 4,
  15. 'shelf_type' => 2,
  16. 'd_charge_sequence' => 3,
  17. 'd_charge_coin' => 10,
  18. 'cp_name' => 'kanshu1',
  19. 'cp_share_type' => 1,
  20. 'cover_image' => 'https://www.baidu.com'
  21. ];
  22. $res = $this->withHeaders([
  23. 'Authorization' => 'Bearer '. $this->token,
  24. ])->json('post','http://localhost/api/videoStock/video/add', $data);
  25. $this->dumpJson($res);
  26. }
  27. public function testUpdate() {
  28. $data = [
  29. 'name' => 'test1-114',
  30. 'total_episode_num' => 10,
  31. 'update_type' => 2,
  32. 'category_id' => 4,
  33. 'shelf_type' => 1,
  34. 'd_charge_sequence' => 3,
  35. 'd_charge_coin' => 10,
  36. 'cp_name' => 'kanshu1',
  37. 'cp_share_type' => 1,
  38. 'cover_image' => 'https://www.baidu.com',
  39. 'id' => 2,
  40. ];
  41. $res = $this->withHeaders([
  42. 'Authorization' => 'Bearer '. $this->token,
  43. ])->json('post','http://localhost/api/videoStock/video/update', $data);
  44. $this->dumpJson($res);
  45. }
  46. public function testList() {
  47. $query = [
  48. 'operateUserId' => null,
  49. ];
  50. $res = $this->withHeaders([
  51. 'Authorization' => 'Bearer '. $this->token,
  52. ])->json('get','http://localhost/api/videoStock/video/list', [
  53. // 'videoName' => '112',
  54. // 'updateType' => 2,
  55. // 'categoryId' => 4,
  56. 'operateUserId' =>10
  57. ]);
  58. // $this->dumpJson($res);
  59. $res->dump();
  60. }
  61. public function testsetChargeConfig() {
  62. $res = $this->withHeaders([
  63. 'Authorization' => 'Bearer '. $this->token,
  64. ])->json('post','http://localhost/api/videoStock/video/setChargeConfig',[
  65. 'id' => 1,
  66. 'chargeCoin' => 67,
  67. 'chargeType' => 1,
  68. 'chargeSequence' => 23
  69. ]);
  70. $res->dump();
  71. }
  72. }