Skip to content

Commit adee7f6

Browse files
committed
fixed tests
1 parent 4d83495 commit adee7f6

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed

src/Adapters/Adapter.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,22 @@ public function getCode()
276276
return $code['code'];
277277
}
278278

279+
public function getHtml()
280+
{
281+
$code = $this->code;
282+
283+
$errors = libxml_use_internal_errors(true);
284+
$entities = libxml_disable_entity_loader(true);
285+
286+
$dom = new \DOMDocument();
287+
$dom->loadHTML(trim($code));
288+
289+
libxml_use_internal_errors($errors);
290+
libxml_disable_entity_loader($entities);
291+
292+
//var_dump($dom->documentElement);
293+
}
294+
279295
/**
280296
* {@inheritdoc}
281297
*/

tests/AolTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function testOne()
99
$this->assertEmbed(
1010
'http://on.aol.com/video/whats-next-for-google-in-two-minutes-518288612',
1111
[
12-
'title' => "What's Next for Google in Two Minutes | AOL.com",
12+
'title' => "What's Next for Google in Two Minutes",
1313
'description' => "Wherein we smoosh Google's 2014 developer conference keynote from 2.5+ hours down to just under two minutes.",
1414
'type' => 'link',
1515
'providerName' => 'AOL.com',

tests/CodepenTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function testOne()
1212
'title' => 'TheaterJS',
1313
'imageWidth' => 384,
1414
'imageHeight' => 225,
15-
'code' => '<iframe id="cp_embed_JoRazP" src="https://codepen.io/Zhouzi/embed/preview/JoRazP?height=300&amp;amp;slug-hash=JoRazP&amp;amp;default-tabs=js,result&amp;amp;host=http%3A%2F%2Fcodepen.io&amp;amp;embed-version=2" title="TheaterJS" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
15+
'code' => '<iframe id="cp_embed_JoRazP" src="https://codepen.io/Zhouzi/embed/preview/JoRazP?height=300&amp;slug-hash=JoRazP&amp;default-tabs=js,result&amp;host=http://codepen.io&amp;embed-version=2" title="TheaterJS" scrolling="no" frameborder="0" height="300" allowtransparency="true" class="cp_embed_iframe" style="width: 100%; overflow: hidden;"></iframe>',
1616
'type' => 'rich',
1717
]
1818
);

tests/SoundcloudTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function testOne()
99
$this->assertEmbed(
1010
'https://soundcloud.com/zedsdead/zeds-dead-twin-shadow-lost-you-feat-dangelo-lacy',
1111
[
12-
'title' => 'Lost You by Zeds Dead',
12+
'title' => "Lost You (feat. D'Angelo Lacy & Twin Shadow) by Zeds Dead",
1313
'type' => 'rich',
1414
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F150745932&show_artwork=true"></iframe>',
1515
'providerName' => 'SoundCloud',

tests/SpotifyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public function testPlay()
99
$this->assertEmbed(
1010
'https://play.spotify.com/album/7s66wU1XJ2NsUuWM2NKiUV',
1111
[
12-
'title' => 'Various Artists - A Cantar con Xabarin (Vol. I & II)',
12+
'title' => 'A Cantar con Xabarin (Vol. I & II)',
1313
'type' => 'rich',
14-
'code' => '<iframe src="https://embed.spotify.com/?uri=spotify:album:7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>',
14+
'code' => '<iframe src="https://open.spotify.com/embed/album/7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>',
1515
'providerName' => 'Spotify',
1616
'providerUrl' => 'https://www.spotify.com',
1717
]
@@ -23,9 +23,9 @@ public function testOpen()
2323
$this->assertEmbed(
2424
'https://open.spotify.com/album/7s66wU1XJ2NsUuWM2NKiUV',
2525
[
26-
'title' => 'Various Artists - A Cantar con Xabarin (Vol. I & II)',
26+
'title' => 'A Cantar con Xabarin (Vol. I & II)',
2727
'type' => 'rich',
28-
'code' => '<iframe src="https://embed.spotify.com/?uri=spotify:album:7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>',
28+
'code' => '<iframe src="https://open.spotify.com/embed/album/7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>',
2929
'providerName' => 'Spotify',
3030
'providerUrl' => 'https://www.spotify.com',
3131
]

tests/WikipediaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class WikipediaTest extends AbstractTestCase
77
public function testOne()
88
{
99
$description = <<<'EOT'
10-
Albert Einstein (/ˈaɪnstaɪn/; German: [ˈalbɛɐ̯t ˈaɪnʃtaɪn]; 14 March 1879 – 18 April 1955) was a German-born theoretical physicist. He developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics). Einstein's work is also known for its influence on the philosophy of science. Einstein is best known in popular culture for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world's most famous equation"). He received the 1921 Nobel Prize in Physics "for his services to theoretical physics, and especially for his discovery of the law of the photoelectric effect", a pivotal step in the evolution of quantum theory. Near the beginning of his career, Einstein thought that Newtonian mechanics was no longer enough to reconcile the laws of classical mechanics with the laws of the electromagnetic field. This led him to develop his special theory of relativity during his time at the Swiss Patent Office in Bern, Switzerland. Briefly before, he aquired the Swiss citizenship...
10+
Albert Einstein (/ˈaɪnstaɪn/; German: [ˈalbɛɐ̯t ˈaɪnʃtaɪn]; 14 March 1879 – 18 April 1955) was a German-born theoretical physicist. He developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics). Einstein's work is also known for its influence on the philosophy of science. Einstein is best known in popular culture for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world's most famous equation"). He received the 1921 Nobel Prize in Physics "for his services to theoretical physics, and especially for his discovery of the law of the photoelectric effect", a pivotal step in the evolution of quantum theory. Near the beginning of his career, Einstein thought that Newtonian mechanics was no longer enough to reconcile the laws of classical mechanics with the laws of the electromagnetic field. This led him to develop his special theory of relativity during his time at the Swiss Patent Office in Bern, Switzerland. He realized, however, that the principle of relativity...
1111
EOT;
1212

1313
$this->assertEmbed(
File renamed without changes.

0 commit comments

Comments
 (0)