diff --git a/src/Youtube.php b/src/Youtube.php index 930ecf3..8b9d3f7 100644 --- a/src/Youtube.php +++ b/src/Youtube.php @@ -38,7 +38,10 @@ public function youtubeEmbedCode() public function youtubeChannelUri() { - return 'https://www.youtube.com/channel/' . $this->regexify(sprintf('[a-zA-Z0-9\-]{1,%s}', $this->numberBetween(1, 20))); + return sprintf('https://www.youtube.com/%s/%s', + $this->randomElement(['channel', 'user']), + $this->regexify(sprintf('[a-zA-Z0-9\-]{1,%s}', $this->numberBetween(1, 20))) + ); } public function youtubeRandomUri() diff --git a/tests/Faker/YoutubeTest.php b/tests/Faker/YoutubeTest.php index a202ee3..1011703 100644 --- a/tests/Faker/YoutubeTest.php +++ b/tests/Faker/YoutubeTest.php @@ -39,7 +39,7 @@ public function testYoutubeEmbedUri() public function testYoutubeChannelUri() { - $this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtube\.com\/channel\/)([a-zA-Z0-9\-]{1,})#', $this->faker->youtubeChannelUri()); + $this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtube\.com\/)(c\/|channel\/|user\/)([a-zA-Z0-9\-]{1,})#', $this->faker->youtubeChannelUri()); } public function testYoutubeEmbedCode()