Skip to content

Commit a1303a5

Browse files
committed
trying to see why urls fails in travis
1 parent 331dcc0 commit a1303a5

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

tests/UrlTest.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,29 @@
22

33
class UrlTest extends TestCaseBase
44
{
5-
public function testParser()
5+
public function urlsParserProvider()
66
{
7-
$urls = [
8-
'http://vimeo.com//69912181?' => 'http://vimeo.com/69912181',
9-
'http://vimeo.com//69912181' => 'http://vimeo.com/69912181',
10-
'http://vimeo.com/69912181' => 'http://vimeo.com/69912181',
11-
'http://vimeo.com/69912181/' => 'http://vimeo.com/69912181/',
12-
'https://www.tumblr.com/oembed/1.0' => 'https://www.tumblr.com/oembed/1.0',
13-
'https://www.tumblr.com/oembed/1.0/' => 'https://www.tumblr.com/oembed/1.0/',
14-
'https://www.tumblr.com/oembed//1.0//' => 'https://www.tumblr.com/oembed/1.0/',
15-
'https://animoto.com/oembeds/create.xml?automated=true&options=start_hq' => 'https://animoto.com/oembeds/create.xml?automated=true&options=start_hq',
16-
'http://static2.politico.com/dims4/default/28fb355/2147483647/resize/1160x%3E/quality/90/?url=http%3A%2F%2Fs3-origin-images.politico.com%2F2013%2F12%2F18%2F131218_george_w_bush_barack_obama_ap_60' => 'http://static2.politico.com/dims4/default/28fb355/2147483647/resize/1160x%3E/quality/90/?url=http%3A%2F%2Fs3-origin-images.politico.com%2F2013%2F12%2F18%2F131218_george_w_bush_barack_obama_ap_60',
7+
return [
8+
['http://vimeo.com//69912181?', 'http://vimeo.com/69912181'],
9+
['http://vimeo.com//69912181', 'http://vimeo.com/69912181'],
10+
['http://vimeo.com/69912181', 'http://vimeo.com/69912181'],
11+
['http://vimeo.com/69912181/', 'http://vimeo.com/69912181/'],
12+
['https://www.tumblr.com/oembed/1.0', 'https://www.tumblr.com/oembed/1.0'],
13+
['https://www.tumblr.com/oembed/1.0/', 'https://www.tumblr.com/oembed/1.0/'],
14+
['https://www.tumblr.com/oembed//1.0//', 'https://www.tumblr.com/oembed/1.0/'],
15+
['https://animoto.com/oembeds/create.xml?automated=true&options=start_hq', 'https://animoto.com/oembeds/create.xml?automated=true&options=start_hq'],
16+
['http://static2.politico.com/dims4/default/28fb355/2147483647/resize/1160x%3E/quality/90/?url=http%3A%2F%2Fs3-origin-images.politico.com%2F2013%2F12%2F18%2F131218_george_w_bush_barack_obama_ap_60', 'http://static2.politico.com/dims4/default/28fb355/2147483647/resize/1160x%3E/quality/90/?url=http%3A%2F%2Fs3-origin-images.politico.com%2F2013%2F12%2F18%2F131218_george_w_bush_barack_obama_ap_60'],
1717
];
18+
}
1819

19-
foreach ($urls as $url => $expected_url) {
20-
$parsed_url = new Embed\Url($url);
20+
/**
21+
* @dataProvider urlsParserProvider
22+
*/
23+
public function testParser($url, $expected_url)
24+
{
25+
$parsed_url = new Embed\Url($url);
2126

22-
$this->assertSame($expected_url, $parsed_url->getUrl());
23-
}
27+
$this->assertSame($expected_url, $parsed_url->getUrl());
2428
}
2529

2630
public function testDirectoryPosition()

0 commit comments

Comments
 (0)