File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Embed \Providers \OEmbed ;
4+
5+ use Embed \Http \Url ;
6+
7+ class Infogram extends EndPoint implements EndPointInterface
8+ {
9+ protected static $ pattern = [
10+ 'infogr.am/* ' ,
11+ 'www.infogr.am/* ' ,
12+ ];
13+ protected static $ endPoint = 'https://infogr.am/oembed ' ;
14+
15+ /**
16+ * {@inheritdoc}
17+ */
18+ public function getEndPoint ()
19+ {
20+ $ url = $ this ->response ->getUrl ()->withScheme ('https ' );
21+
22+ return Url::create (static ::$ endPoint )
23+ ->withQueryParameters ([
24+ 'url ' => (string ) $ url ,
25+ ]);
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Embed \Tests ;
4+
5+ class InfogramTest extends AbstractTestCase
6+ {
7+ public function testOne ()
8+ {
9+ $ this ->assertEmbed (
10+ 'https://infogr.am/7743c36a-f3ca-4465-9a80-a8abbd5d8dc4 ' ,
11+ [
12+ 'title ' => 'Frost Bank Advisors (online graphic) ' ,
13+ 'width ' => 550 ,
14+ 'height ' => 600 ,
15+ 'type ' => 'rich ' ,
16+ 'providerName ' => 'Infogram ' ,
17+ 'author_url ' => 'https://infogram.com/sabjnewsroom01 ' ,
18+ ]
19+ );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments