Skip to content

Commit e7b3688

Browse files
committed
added oembed support for polldaddy
1 parent 5d3df76 commit e7b3688

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/Providers/OEmbed/Polldaddy.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
namespace Embed\Providers\OEmbed;
3+
4+
class Polldaddy extends OEmbedImplementation
5+
{
6+
/**
7+
* {@inheritdoc}
8+
*/
9+
public static function getEndPoint()
10+
{
11+
return 'http://polldaddy.com/oembed';
12+
}
13+
14+
/**
15+
* {@inheritdoc}
16+
*/
17+
public static function getPatterns()
18+
{
19+
return ['https?://polldaddy.com/poll/*'];
20+
}
21+
}

tests/PolldaddyTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
class PolldaddyTest extends PHPUnit_Framework_TestCase
3+
{
4+
public function testOne()
5+
{
6+
$info = Embed\Embed::create('http://polldaddy.com/poll/7012505/');
7+
8+
$this->assertEquals($info->title, "Which design do you prefer?");
9+
$this->assertEquals($info->description, 'Poll Answers: Option #1, Option #2,');
10+
$this->assertEquals($info->code, '<script type="text/javascript" charset="utf-8" src="https://secure.polldaddy.com/p/7012505.js"></script><noscript><a href="https://polldaddy.com/poll/7012505/">Which design do you prefer?</a></noscript>');
11+
$this->assertEquals($info->type, 'rich');
12+
$this->assertEquals($info->providerName, 'Polldaddy');
13+
}
14+
}

0 commit comments

Comments
 (0)