EpisodeControllerTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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/list', [
  13. 'video_id' => 1
  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' => 2,
  23. 'videos' => [
  24. ['name' => '01_xxx', 'duration' => 12342, 'url' => 'url1'],
  25. ['name' => '02_xxx', 'duration' => 1222, 'url' => 'url2'],
  26. ['name' => '03_xxx', 'duration' => 3342, 'url' => 'url3'],
  27. ]
  28. ]);
  29. $this->dumpJson($res);
  30. }
  31. }