File tree Expand file tree Collapse file tree 2 files changed +31
-4
lines changed Expand file tree Collapse file tree 2 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class UrlRedirect
1111 'google ' => 'https?://www.google.com/url* ' ,
1212 'googleTranslator ' => 'https?://translate.google.com/translate* ' ,
1313 'hashBang ' => '*#!* ' ,
14+ 'spotify ' => 'https://play.spotify.com/* ' ,
1415 ];
1516
1617 /**
@@ -80,4 +81,16 @@ protected static function hashBang(Url $url)
8081
8182 return $ url ->getUrl ();
8283 }
84+
85+ /**
86+ * Redirect the player of spotify.
87+ *
88+ * @param Url $url
89+ *
90+ * @return string
91+ */
92+ protected static function spotify (Url $ url )
93+ {
94+ return $ url ->withHost ('open.spotify.com ' )->getUrl ();
95+ }
8396}
Original file line number Diff line number Diff line change 22
33class SpotifyTest extends TestCaseBase
44{
5- public function testOne ()
5+ public function testPlay ()
66 {
77 $ this ->assertEmbed (
8- 'http ://open .spotify.com/track/7nDQMtLxu94xtlTR8bEqjU ' ,
8+ 'https ://play .spotify.com/album/7s66wU1XJ2NsUuWM2NKiUV ' ,
99 [
10- 'title ' => 'Zhu - Faded ' ,
10+ 'title ' => 'Various Artists - A Cantar con Xabarin (Vol. I & II) ' ,
1111 'type ' => 'rich ' ,
12- 'code ' => '<iframe src="https://embed.spotify.com/?uri=spotify:track:7nDQMtLxu94xtlTR8bEqjU" width="300" height="380" frameborder="0" allowtransparency="true"></iframe> ' ,
12+ 'code ' => '<iframe src="https://embed.spotify.com/?uri=spotify:album:7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe> ' ,
13+ 'providerName ' => 'Spotify ' ,
14+ 'providerUrl ' => 'https://www.spotify.com ' ,
15+ ]
16+ );
17+ }
18+
19+ public function testOpen ()
20+ {
21+ $ this ->assertEmbed (
22+ 'https://open.spotify.com/album/7s66wU1XJ2NsUuWM2NKiUV ' ,
23+ [
24+ 'title ' => 'Various Artists - A Cantar con Xabarin (Vol. I & II) ' ,
25+ 'type ' => 'rich ' ,
26+ 'code ' => '<iframe src="https://embed.spotify.com/?uri=spotify:album:7s66wU1XJ2NsUuWM2NKiUV" width="300" height="380" frameborder="0" allowtransparency="true"></iframe> ' ,
1327 'providerName ' => 'Spotify ' ,
1428 'providerUrl ' => 'https://www.spotify.com ' ,
1529 ]
You can’t perform that action at this time.
0 commit comments