test(phpunit): Disable Vimeo tests on CI

This commit is contained in:
Pierre Rudloff 2019-04-19 23:26:03 +02:00
parent 9949a0d32b
commit 71200c80bc
2 changed files with 34 additions and 7 deletions

View file

@ -292,6 +292,9 @@ class FrontControllerTest extends TestCase
*/ */
public function testVideoWithVimeoAudio() public function testVideoWithVimeoAudio()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
// So we can test the fallback to default format // So we can test the fallback to default format
$this->assertRequestIsOk('video', ['url' => 'https://vimeo.com/251997032', 'audio' => true]); $this->assertRequestIsOk('video', ['url' => 'https://vimeo.com/251997032', 'audio' => true]);
} }
@ -319,6 +322,9 @@ class FrontControllerTest extends TestCase
*/ */
public function testVideoWithPassword() public function testVideoWithPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$result = $this->controller->video( $result = $this->controller->video(
$this->request->withQueryParams(['url' => 'http://vimeo.com/68375962']) $this->request->withQueryParams(['url' => 'http://vimeo.com/68375962'])
->withParsedBody(['password' => 'youtube-dl']), ->withParsedBody(['password' => 'youtube-dl']),
@ -334,6 +340,9 @@ class FrontControllerTest extends TestCase
*/ */
public function testVideoWithMissingPassword() public function testVideoWithMissingPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962']); $this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962']);
$this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962', 'audio' => true]); $this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962', 'audio' => true]);
} }
@ -502,6 +511,9 @@ class FrontControllerTest extends TestCase
*/ */
public function testRedirectWithMissingPassword() public function testRedirectWithMissingPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$this->assertRequestIsRedirect('redirect', ['url' => 'http://vimeo.com/68375962']); $this->assertRequestIsRedirect('redirect', ['url' => 'http://vimeo.com/68375962']);
} }

View file

@ -117,6 +117,9 @@ class VideoDownloadTest extends TestCase
*/ */
public function testGetURLWithPassword() public function testGetURLWithPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$videoURL = $this->download->getURL('http://vimeo.com/68375962', null, 'youtube-dl'); $videoURL = $this->download->getURL('http://vimeo.com/68375962', null, 'youtube-dl');
$this->assertContains('vimeocdn.com', $videoURL[0]); $this->assertContains('vimeocdn.com', $videoURL[0]);
} }
@ -129,6 +132,9 @@ class VideoDownloadTest extends TestCase
*/ */
public function testGetURLWithMissingPassword() public function testGetURLWithMissingPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$this->download->getURL('http://vimeo.com/68375962'); $this->download->getURL('http://vimeo.com/68375962');
} }
@ -140,6 +146,9 @@ class VideoDownloadTest extends TestCase
*/ */
public function testGetURLWithWrongPassword() public function testGetURLWithWrongPassword()
{ {
if (getenv('CI')) {
$this->markTestSkipped('Travis is blacklisted by Vimeo.');
}
$this->download->getURL('http://vimeo.com/68375962', null, 'foo'); $this->download->getURL('http://vimeo.com/68375962', null, 'foo');
} }
@ -164,7 +173,7 @@ class VideoDownloadTest extends TestCase
*/ */
public function urlProvider() public function urlProvider()
{ {
return [ $videos = [
[ [
'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'best[protocol^=http]', 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'best[protocol^=http]',
'It_s_Not_Me_It_s_You_-_Hearts_Under_Fire-M7IpKCZ47pU', 'It_s_Not_Me_It_s_You_-_Hearts_Under_Fire-M7IpKCZ47pU',
@ -178,12 +187,6 @@ class VideoDownloadTest extends TestCase
'mp4', 'mp4',
'googlevideo.com', 'googlevideo.com',
], ],
[
'https://vimeo.com/24195442', 'best[protocol^=http]',
'Carving_the_Mountains-24195442',
'mp4',
'vimeocdn.com',
],
[ [
'http://www.bbc.co.uk/programmes/b039g8p7', 'bestaudio/best', 'http://www.bbc.co.uk/programmes/b039g8p7', 'bestaudio/best',
'Kaleidoscope_Leonard_Cohen-b039d07m', 'Kaleidoscope_Leonard_Cohen-b039d07m',
@ -203,6 +206,18 @@ class VideoDownloadTest extends TestCase
'openload.co', 'openload.co',
], ],
]; ];
if (!getenv('CI')) {
// Travis is blacklisted by Vimeo.
$videos[] = [
'https://vimeo.com/24195442', 'best[protocol^=http]',
'Carving_the_Mountains-24195442',
'mp4',
'vimeocdn.com',
];
}
return $videos;
} }
/** /**