EpisodeControllerTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Tests\Video\Http\Controllers;
  3. use Modules\Video\Http\Controllers\EpisodeController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class EpisodeControllerTest extends UsedTestCase
  7. {
  8. public function testList()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('get','http://localhost/api/videoStock/episode/downloadList', [
  13. 'video_id' => 3
  14. ]);
  15. $this->dumpJson($res);
  16. }
  17. public function testAdd()
  18. {
  19. $res = $this->withHeaders([
  20. 'Authorization' => 'Bearer '. $this->token,
  21. ])->json('post','http://localhost/api/videoStock/episode/add', [
  22. 'video_id' => 3,
  23. 'videos' => [
  24. ['name' => '01_xxx', 'duration' => 12342, 'key' => 'url1'],
  25. ['name' => '02_xxx', 'duration' => 1222, 'key' => 'url2'],
  26. ['name' => '03_xxx', 'duration' => 3342, 'key' => 'url3'],
  27. ['name' => '04_xxx', 'duration' => 3342, 'key' => 'url3'],
  28. ]
  29. ]);
  30. // $this->dumpJson($res);
  31. $res->dump();
  32. }
  33. }