Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aalaap committed Nov 7, 2020
1 parent 68b4c1d commit eff2f96
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Faker/YoutubeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ class YoutubeTest extends TestCase
*/
private $faker;

protected function setUp()
protected function setUp(): void
{
$faker = Factory::create();
$faker->addProvider(new Youtube($faker));
$this->faker = $faker;
}

public function testYoutubeUri()
public function testYoutubeUri(): void
{
$this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtube\.com\/watch\?v=)(.+)#', $this->faker->youtubeUri());
}

public function testYoutubeShortUri()
public function testYoutubeShortUri(): void
{
$this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtu.be\/)(.+)#', $this->faker->youtubeShortUri());
}

public function testYoutubeEmbedUri()
public function testYoutubeEmbedUri(): void
{
$this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtube\.com\/embed\/)(.+)#', $this->faker->youtubeEmbedUri());
}

public function testYoutubeChannelUri()
public function testYoutubeChannelUri(): void
{
$this->assertRegExp('#(http(s)??\:\/\/)?(www\.)?(youtube\.com\/)(c\/|channel\/|user\/)([a-zA-Z0-9\-]{1,})#', $this->faker->youtubeChannelUri());
}

public function testYoutubeEmbedCode()
public function testYoutubeEmbedCode(): void
{
$this->assertRegExp('#<iframe width="(\d+)" height="(\d+)" src="((http(s)??\:\/\/)?(www\.)?(youtube\.com\/embed\/)(.+))" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen><\/iframe>#', $this->faker->youtubeEmbedCode());
}
}
}

0 comments on commit eff2f96

Please sign in to comment.