MediaTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * This file is part of the PHP-FFmpeg-video-streaming package.
  4. *
  5. * (c) Amin Yazdanpanah <contact@aminyazdanpanah.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Tests\FFMpegStreaming;
  11. use Streaming\DASH;
  12. use Streaming\HLS;
  13. use Streaming\Media;
  14. use FFMpeg\FFProbe\DataMapping\Stream;
  15. class MediaTest extends TestCase
  16. {
  17. public function testMediaClass()
  18. {
  19. $media = $this->getVideo();
  20. $this->assertInstanceOf(Media::class, $media);
  21. }
  22. public function testDASH()
  23. {
  24. $this->assertInstanceOf(DASH::class, $this->getDASH());
  25. }
  26. public function testHLS()
  27. {
  28. $this->assertInstanceOf(HLS::class, $this->getHLS());
  29. }
  30. public function testGetPath()
  31. {
  32. $media = $this->getVideo();
  33. $get_path_info = pathinfo($media->getPathfile());
  34. $this->assertIsArray($get_path_info);
  35. $this->assertArrayHasKey('dirname', $get_path_info);
  36. $this->assertArrayHasKey('filename', $get_path_info);
  37. }
  38. private function getDASH()
  39. {
  40. $media = $this->getVideo();
  41. return $media->DASH();
  42. }
  43. private function getHLS()
  44. {
  45. $media = $this->getVideo();
  46. return $media->HLS();
  47. }
  48. }