���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/vidoe.top/vendor/athlon1600/youtube-downloader/tests/ |
<?php namespace YouTube\Tests; use PHPUnit\Framework\TestCase; use YouTube\Utils\Utils; class YouTubeUrlTest extends TestCase { const BUNNY_VIDEO_ID = "aqz-KE-bpKQ"; public function test_id_parsing() { $file = dirname(dirname(__FILE__)) . '/etc/youtube_urls.txt'; $contents = file_get_contents($file); $lines = explode(PHP_EOL, $contents); foreach ($lines as $line) { $id = Utils::extractVideoId($line); $this->assertEquals(self::BUNNY_VIDEO_ID, $id); } } public function test_channel_parsing() { $tests = [ 'https://www.youtube.com/channel/UCkRfArvrzheW2E7b6SVT7vQ' => 'UCkRfArvrzheW2E7b6SVT7vQ', 'https://www.youtube.com/channel/UC295-Dw_tDNtZXFeAPAW6Aw' => 'UC295-Dw_tDNtZXFeAPAW6Aw', // 'https://www.youtube.com/user/creatoracademy' => 'creatoracademy', 'https://www.youtube.com/c/YouTubeCreators' => 'YouTubeCreators', 'https://www.youtube.com/c/youtubecreators/videos' => 'youtubecreators', 'https://www.youtube.com/feed/explore' => null, '' => null ]; $this->assertNull(Utils::extractChannel(null)); foreach ($tests as $url => $expected) { $this->assertEquals($expected, Utils::extractChannel($url)); } } }