Beispiel #1
0
 public function testCustomProvider()
 {
     $oembed = new MockOembed(new MockHttpRequest());
     $customParams = array('apikey' => 'myapikey');
     $urls = array('http://customservice.com/9879837498', 'http://host.com/stuff/yes', 'http://customservice.com/hi', 'http://www.customservice.com/98756478', 'http://customservice.com/9879837498/');
     $p = new \Embera\Providers(array('oembed' => true), $oembed);
     $p->addProvider('www.customservice.com', 'CustomService', $customParams);
     $this->assertCount(3, $p->getAll($urls));
     $all = $p->getAll($urls);
     foreach ($all as $s) {
         $params = array_filter($s->getParams());
         $this->assertEquals($params, $customParams);
     }
 }