EpisodeControllerTest.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Tests\Video\Http\Controllers;
  3. use Modules\Video\Http\Controllers\BankAccountController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class EpisodeControllerTest extends UsedTestCase
  7. {
  8. public function testCreateModule() {
  9. $res = $this->withHeaders([
  10. 'Authorization' => 'Bearer '. $this->token,
  11. ])->json('post','http://localhost/api/module', [
  12. "title" => "yinliu",
  13. "path" => "yinliu",
  14. "keywords" => "yinliu",
  15. "description" => "引流管理",
  16. "dirs" => [
  17. "controllers" => true,
  18. "models" => true,
  19. "database" => true,
  20. "requests" => true,
  21. ],
  22. ]);
  23. $this->dumpJson($res);
  24. }
  25. public function testList()
  26. {
  27. $res = $this->withHeaders([
  28. 'Authorization' => 'Bearer '. $this->token,
  29. ])->json('get','http://localhost/api/videoStock/episode/downloadList', [
  30. 'video_id' => 3,
  31. 'need_wechat_status' => 1
  32. ]);
  33. $this->dumpJson($res);
  34. }
  35. public function testAdd()
  36. {
  37. $res = $this->withHeaders([
  38. 'Authorization' => 'Bearer '. $this->token,
  39. ])->json('post','http://localhost/api/videoStock/episode/add', [
  40. 'video_id' => 3,
  41. 'videos' => [
  42. ['name' => '01_xxx', 'duration' => 12342, 'key' => 'url1234'],
  43. ['name' => '02_xxx', 'duration' => 1222, 'key' => 'url244'],
  44. ['name' => '03_xxx', 'duration' => 3342, 'key' => 'url344'],
  45. ['name' => '04_xxx', 'duration' => 3342, 'key' => 'url344'],
  46. ]
  47. ]);
  48. // $this->dumpJson($res);
  49. $res->dump();
  50. }
  51. }