ElementFactoryTest.php 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <?php
  2. namespace Muzich\CoreBundle\Tests\Searcher;
  3. use Muzich\CoreBundle\lib\UnitTest;
  4. use Muzich\CoreBundle\Entity\Element;
  5. use Muzich\CoreBundle\Managers\ElementManager;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. class ElementFactoryTest extends UnitTest
  8. {
  9. /**
  10. * Test du fonctionnement du l'usine
  11. * C'est plus un test fusible car il ne test que la méthode proceedFill.
  12. *
  13. */
  14. public function testEngine()
  15. {
  16. $r = $this->getDoctrine();
  17. $bux = $r->getRepository('MuzichCoreBundle:User')
  18. ->findOneByUsername('bux')
  19. ;
  20. $hardtek = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Hardtek');
  21. $tribe = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Tribe');
  22. $youtube_width = '590';
  23. $youtube_height = '300';
  24. $element = new Element();
  25. $element->setName('Mon bel element');
  26. $element->setTags(json_encode(array($hardtek->getId(), $tribe->getId())));
  27. $element->setUrl('http://www.youtube.com/watch?v=WC8qb_of04E');
  28. $factory = new ElementManager($element, $r->getEntityManager(), $this->_container);
  29. $factory->proceedFill($bux);
  30. $url = 'http://www.youtube.com/embed/WC8qb_of04E';
  31. $this->assertEquals($element->getName(), 'Mon bel element');
  32. $this->assertEquals($element->getUrl(), 'http://www.youtube.com/watch?v=WC8qb_of04E');
  33. $this->assertEquals($element->getTags(), array($hardtek, $tribe));
  34. $this->assertEquals($element->getEmbed(),
  35. '<iframe width="'.$youtube_width.'" height="'.$youtube_height.'" src="'.$url.'" '
  36. .'frameborder="0" allowfullscreen></iframe>'
  37. );
  38. }
  39. /**
  40. * Test des création de code embed
  41. */
  42. public function testEmbedsEngine()
  43. {
  44. $r = $this->getDoctrine();
  45. $bux = $r->getRepository('MuzichCoreBundle:User')
  46. ->findOneByUsername('bux')
  47. ;
  48. $hardtek = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Hardtek');
  49. $tribe = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Tribe');
  50. /*
  51. * - youtube.com && youtu.be
  52. */
  53. $this->proceed_elementAndFill(
  54. $bux,
  55. 'dfd4z5d3s45sgf45645',
  56. 'http://www.youtube.com/watch?v=Itfg7UpkcSs&feature=g-vrec&context=G2e61726RVAAAAAAAAAg',
  57. array($hardtek->getId(), $tribe->getId()),
  58. '<iframe width="'.$this->getParam('youtube_player_width').'" '
  59. .'height="'.$this->getParam('youtube_player_height').'" '
  60. .'src="http://www.youtube.com/embed/Itfg7UpkcSs" '
  61. .'frameborder="0" allowfullscreen></iframe>'
  62. );
  63. $this->proceed_elementAndFill(
  64. $bux,
  65. 'dfd4z5d3s45sgf45645',
  66. 'http://www.youtube.com/watch?feature=player_detailpage&v=Itfg7UpkcSs#t=3s',
  67. array($hardtek->getId(), $tribe->getId()),
  68. '<iframe width="'.$this->getParam('youtube_player_width').'" '
  69. .'height="'.$this->getParam('youtube_player_height').'" '
  70. .'src="http://www.youtube.com/embed/Itfg7UpkcSs" '
  71. .'frameborder="0" allowfullscreen></iframe>'
  72. );
  73. $this->proceed_elementAndFill(
  74. $bux,
  75. 'dfd4z5d3s45sgf45645',
  76. 'http://youtu.be/Itfg7UpkcSs',
  77. array($hardtek->getId(), $tribe->getId()),
  78. '<iframe width="'.$this->getParam('youtube_player_width').'" '
  79. .'height="'.$this->getParam('youtube_player_height').'" '
  80. .'src="http://www.youtube.com/embed/Itfg7UpkcSs" '
  81. .'frameborder="0" allowfullscreen></iframe>'
  82. );
  83. $this->proceed_elementAndFill(
  84. $bux,
  85. 'dfd4z5d3s45sgf45645',
  86. 'http://www.youtube.com/watch?v=Itfg7UpkcSs',
  87. array($hardtek->getId(), $tribe->getId()),
  88. '<iframe width="'.$this->getParam('youtube_player_width').'" '
  89. .'height="'.$this->getParam('youtube_player_height').'" '
  90. .'src="http://www.youtube.com/embed/Itfg7UpkcSs" '
  91. .'frameborder="0" allowfullscreen></iframe>'
  92. );
  93. /*
  94. * - dailymotion.com
  95. */
  96. $this->proceed_elementAndFill(
  97. $bux,
  98. 'fzgrj79ukl46ye4rgz6a',
  99. 'http://www.dailymotion.com/video/xafj1q_black-bomb-a-tales-from-the-old-sch_music',
  100. array($hardtek->getId(), $tribe->getId()),
  101. '<iframe frameborder="0" width="'.$this->getParam('dailymotion_player_width').'" '
  102. .'height="'.$this->getParam('dailymotion_player_height').'" '
  103. .'src="http://www.dailymotion.com/embed/video/xafj1q?autoPlay=1"></iframe>'
  104. );
  105. /*
  106. * - soundcloud.com
  107. */
  108. $url_id = 'http://soundcloud.com/matas/sets/library-project';
  109. $embed_id = md5($url_id);
  110. $this->proceed_elementAndFill(
  111. $bux,
  112. 'faez7tf8re9h4gf5j64dssz',
  113. 'http://soundcloud.com/matas/sets/library-project',
  114. array($hardtek->getId(), $tribe->getId()),
  115. '<object height="'.$this->getParam('soundcloud_player_height').'" width="100%" id="embed_'.$embed_id.'" '
  116. .'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
  117. <param name="movie" value="http://player.soundcloud.com/player.swf?url='.$url_id.'&amp;'
  118. .'enable_api=true&amp;object_id=embed_'.$embed_id.'"></param>
  119. <param name="allowscriptaccess" value="always"></param>
  120. <embed allowscriptaccess="always" height="'.$this->getParam('soundcloud_player_height').'" '
  121. .'src="http://player.soundcloud.com/player.swf?url='.$url_id.'&amp;enable_api=true'
  122. .'&amp;object_id=embed_'.$embed_id.'" type="application/x-shockwave-flash" '
  123. .'width="100%" name="embed_'.$embed_id.'"></embed>
  124. </object>'
  125. );
  126. $url_id = 'http://soundcloud.com/matas/above-hyperion-redux';
  127. $embed_id = md5($url_id);
  128. $this->proceed_elementAndFill(
  129. $bux,
  130. 'faez7tf8re9h4gf5j64dssz',
  131. 'http://soundcloud.com/matas/above-hyperion-redux',
  132. array($hardtek->getId(), $tribe->getId()),
  133. '<object height="'.$this->getParam('soundcloud_player_height').'" width="100%" id="embed_'.$embed_id.'" '
  134. .'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
  135. <param name="movie" value="http://player.soundcloud.com/player.swf?url='.$url_id.'&amp;'
  136. .'enable_api=true&amp;object_id=embed_'.$embed_id.'"></param>
  137. <param name="allowscriptaccess" value="always"></param>
  138. <embed allowscriptaccess="always" height="'.$this->getParam('soundcloud_player_height').'" '
  139. .'src="http://player.soundcloud.com/player.swf?url='.$url_id.'&amp;enable_api=true'
  140. .'&amp;object_id=embed_'.$embed_id.'" type="application/x-shockwave-flash" '
  141. .'width="100%" name="embed_'.$embed_id.'"></embed>
  142. </object>'
  143. );
  144. $this->proceed_elementAndFill(
  145. $bux,
  146. 'faez7tf8re9h4gf5j64dssz',
  147. 'http://soundcloud.com/tracks/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=',
  148. array($hardtek->getId(), $tribe->getId()),
  149. null
  150. );
  151. $this->proceed_elementAndFill(
  152. $bux,
  153. 'faez7tf8re9h4gf5j64dssz',
  154. 'http://soundcloud.com/people/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=',
  155. array($hardtek->getId(), $tribe->getId()),
  156. null
  157. );
  158. $this->proceed_elementAndFill(
  159. $bux,
  160. 'faez7tf8re9h4gf5j64dssz',
  161. 'http://soundcloud.com/groups/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=',
  162. array($hardtek->getId(), $tribe->getId()),
  163. null
  164. );
  165. /*
  166. * - jamendo.com
  167. */
  168. $this->proceed_elementAndFill(
  169. $bux,
  170. 'gthyk456+liszz',
  171. 'http://www.jamendo.com/fr/album/30661',
  172. array($hardtek->getId(), $tribe->getId()),
  173. '<object width="'.$this->getParam('jamendo_player_width').'" height="'.$this->getParam('jamendo_player_height').'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
  174. .' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" align="middle">
  175. <param name="allowScriptAccess" value="always" />
  176. <param name="wmode" value="transparent" />
  177. <param name="movie" value="http://widgets.jamendo.com/fr/album/?album_id=30661&playertype=2008" />
  178. <param name="quality" value="high" />
  179. <param name="bgcolor" value="#FFFFFF" />
  180. <embed src="http://widgets.jamendo.com/fr/album/?album_id=30661&playertype=2008" quality="high" wmode="transparent" bgcolor="#FFFFFF"'
  181. .' width="'.$this->getParam('jamendo_player_width').'" height="'.$this->getParam('jamendo_player_height').'" align="middle" allowScriptAccess="always"'
  182. .' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
  183. &nbsp;
  184. </embed>
  185. &nbsp;
  186. </object>'
  187. );
  188. $this->proceed_elementAndFill(
  189. $bux,
  190. 'gthyk456+liszz',
  191. 'http://www.jamendo.com/fr/track/207079',
  192. array($hardtek->getId(), $tribe->getId()),
  193. '<object width="'.$this->getParam('jamendo_player_width').'" height="'.$this->getParam('jamendo_player_height').'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
  194. .' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" align="middle">
  195. <param name="allowScriptAccess" value="always" />
  196. <param name="wmode" value="transparent" />
  197. <param name="movie" value="http://widgets.jamendo.com/fr/track/?track_id=207079&playertype=2008" />
  198. <param name="quality" value="high" />
  199. <param name="bgcolor" value="#FFFFFF" />
  200. <embed src="http://widgets.jamendo.com/fr/track/?track_id=207079&playertype=2008" quality="high" wmode="transparent" bgcolor="#FFFFFF"'
  201. .' width="'.$this->getParam('jamendo_player_width').'" height="'.$this->getParam('jamendo_player_height').'" align="middle" allowScriptAccess="always"'
  202. .' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
  203. &nbsp;
  204. </embed>
  205. &nbsp;
  206. </object>'
  207. );
  208. $this->proceed_elementAndFill(
  209. $bux,
  210. 'gthyk456+liszz',
  211. 'http://www.jamendo.com/fr/search/all/psytrance',
  212. array($hardtek->getId(), $tribe->getId()),
  213. null
  214. );
  215. $this->proceed_elementAndFill(
  216. $bux,
  217. 'gthyk456+liszz',
  218. 'http://www.jamendo.com/fr/artist/DJ_BETO',
  219. array($hardtek->getId(), $tribe->getId()),
  220. null
  221. );
  222. /*/*
  223. * - deezer.com
  224. */
  225. $this->proceed_elementAndFill(
  226. $bux,
  227. 'a9j4l56dsu8ra5gf647je',
  228. 'http://www.deezer.com/fr/music/pantera/far-beyond-driven-80398',
  229. array($hardtek->getId(), $tribe->getId()),
  230. '<iframe scrolling="no" frameborder="0" allowTransparency="true" '
  231. .'src="http://www.deezer.com/fr/plugins/player?autoplay=true&playlist=true'
  232. .'&width='.$this->getParam('deezer_player_width').'&height='
  233. .$this->getParam('deezer_player_height')
  234. .'&cover=true&btn_popup=true&type=album&id=80398&title=" '
  235. .'width="'.$this->getParam('deezer_player_width').'" height="'
  236. .$this->getParam('deezer_player_height')
  237. .'"></iframe>'
  238. );
  239. $this->proceed_elementAndFill(
  240. $bux,
  241. 'g4th4545ku6kti456e456z',
  242. 'http://www.deezer.com/fr/music/playlist/18701350',
  243. array($hardtek->getId(), $tribe->getId()),
  244. '<iframe scrolling="no" frameborder="0" allowTransparency="true" '
  245. .'src="http://www.deezer.com/fr/plugins/player?autoplay=true&playlist=true'
  246. .'&width='.$this->getParam('deezer_player_width').'&height='
  247. .$this->getParam('deezer_player_height')
  248. .'&cover=true&btn_popup=true&type=playlist&id=18701350&title=" '
  249. .'width="'.$this->getParam('deezer_player_width').'" height="'
  250. .$this->getParam('deezer_player_height')
  251. .'"></iframe>'
  252. );
  253. }
  254. public function testDataApiengine()
  255. {
  256. $r = $this->getDoctrine();
  257. $bux = $r->getRepository('MuzichCoreBundle:User')
  258. ->findOneByUsername('bux')
  259. ;
  260. /*
  261. * - youtube.com && youtu.be
  262. */
  263. $this->assertEquals(array(
  264. 'data_ref_id' => 'Itfg7UpkcSs',
  265. 'data_title' => 'DIDIER SUPER SUR FRANCE O : UN PETIT MALENTENDU ?'
  266. ),$this->proceed_element_datas_api(
  267. $bux,
  268. 'http://www.youtube.com/watch?v=Itfg7UpkcSs&feature=g-vrec&context=G2e61726RVAAAAAAAAAg'
  269. ));
  270. $this->assertEquals(array(
  271. 'data_ref_id' => 'Itfg7UpkcSs',
  272. 'data_title' => 'DIDIER SUPER SUR FRANCE O : UN PETIT MALENTENDU ?'
  273. ),$this->proceed_element_datas_api(
  274. $bux,
  275. 'http://www.youtube.com/watch?feature=player_detailpage&v=Itfg7UpkcSs#t=3s'
  276. ));
  277. $this->assertEquals(array(
  278. 'data_ref_id' => 'Itfg7UpkcSs',
  279. 'data_title' => 'DIDIER SUPER SUR FRANCE O : UN PETIT MALENTENDU ?'
  280. ),$this->proceed_element_datas_api(
  281. $bux,
  282. 'http://youtu.be/Itfg7UpkcSs'
  283. ));
  284. $this->assertEquals(array(
  285. 'data_ref_id' => 'Itfg7UpkcSs',
  286. 'data_title' => 'DIDIER SUPER SUR FRANCE O : UN PETIT MALENTENDU ?'
  287. ),$this->proceed_element_datas_api(
  288. $bux,
  289. 'http://www.youtube.com/watch?v=Itfg7UpkcSs'
  290. ));
  291. /*
  292. * - dailymotion.com
  293. */
  294. // 'http://www.dailymotion.com/video/xafj1q_black-bomb-a-tales-from-the-old-sch_music',
  295. // TODO: l'url est pas toujours la même pour le thumb :/
  296. // $this->assertEquals(array(
  297. // 'data_ref_id' => 'xafj1q',
  298. // 'data_thumb_url' => 'http://static2.dmcdn.net/static/video/686/025/17520686:jpeg_preview_medium.jpg?20110820212502'
  299. // ),$this->proceed_element_datas_api(
  300. // $bux,
  301. // 'http://www.dailymotion.com/video/xafj1q_black-bomb-a-tales-from-the-old-sch_music'
  302. // ));
  303. /*
  304. * - soundcloud.com
  305. */
  306. // 'http://soundcloud.com/matas/sets/library-project'
  307. // On retire le test de "data_thumb_url", chez sound cloud ca arrete pas de
  308. // changer en ce moment
  309. $datas = $this->proceed_element_datas_api(
  310. $bux,
  311. 'http://soundcloud.com/matas/sets/library-project'
  312. );
  313. $this->assertTrue(array_key_exists('data_thumb_url', $datas));
  314. if (array_key_exists('data_thumb_url', $datas))
  315. {
  316. unset($datas['data_thumb_url']);
  317. }
  318. $this->assertEquals(array(
  319. 'data_ref_id' => 3770,
  320. 'data_title' => 'Library Project',
  321. //'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?51826bf',
  322. 'data_type' => 'playlist',
  323. 'data_download' => null,
  324. 'data_download_url' => 'http://soundcloud.com/matas/sets/library-project/download',
  325. 'data_artist' => 'matas',
  326. 'data_normalized_url' => 'http://api.soundcloud.com/playlists/3770',
  327. 'data_tags' => array(0 => '')
  328. ),$datas);
  329. // Test des tags récupérés
  330. $datas = $this->proceed_element_datas_api(
  331. $bux,
  332. 'https://soundcloud.com/mixessss3/white-stripes-vs-led-zeppelin-icky-kinky-love-rock-mashup-dj-zebra'
  333. );
  334. $this->assertTrue(array_key_exists('data_thumb_url', $datas));
  335. if (array_key_exists('data_thumb_url', $datas))
  336. {
  337. unset($datas['data_thumb_url']);
  338. }
  339. $this->assertEquals(array(
  340. 'data_ref_id' => 2215186,
  341. 'data_title' => 'White Stripes Vs Led Zeppelin - Icky Kinky Love (Rock Mashup) DJ Zebra',
  342. //'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?51826bf',
  343. 'data_type' => 'track',
  344. 'data_download' => false,
  345. 'data_download_url' => 'https://soundcloud.com/mixessss3/white-stripes-vs-led-zeppelin-icky-kinky-love-rock-mashup-dj-zebra/download',
  346. 'data_artist' => 'Mixes and Mashups #3',
  347. 'data_normalized_url' => 'http://api.soundcloud.com/tracks/2215186',
  348. 'data_tags' => array(0 => 'Rock', 1 => 'rock ')
  349. ),$datas);
  350. // 'http://soundcloud.com/matas/above-hyperion-redux'
  351. $datas = $this->proceed_element_datas_api(
  352. $bux,
  353. 'http://soundcloud.com/matas/above-hyperion-redux'
  354. );
  355. $this->assertTrue(array_key_exists('data_thumb_url', $datas));
  356. if (array_key_exists('data_thumb_url', $datas))
  357. {
  358. unset($datas['data_thumb_url']);
  359. }
  360. $this->assertEquals(array(
  361. 'data_ref_id' => 3154252,
  362. 'data_title' => 'Above Hyperion (redux)',
  363. //'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000001536693-gb1n5v-large.jpg?51826bf',
  364. 'data_type' => 'track',
  365. 'data_download' => false,
  366. 'data_download_url' => 'http://soundcloud.com/matas/above-hyperion-redux/download',
  367. 'data_artist' => 'matas',
  368. 'data_tags' => array(
  369. 0 => 'Spacestep'
  370. ),
  371. 'data_normalized_url' => 'http://api.soundcloud.com/tracks/3154252'
  372. ),$datas);
  373. // 'http://soundcloud.com/tracks/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  374. $this->assertEquals(array(
  375. ),$this->proceed_element_datas_api(
  376. $bux,
  377. 'http://soundcloud.com/tracks/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  378. ));
  379. //'http://soundcloud.com/people/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  380. $this->assertEquals(array(
  381. ),$this->proceed_element_datas_api(
  382. $bux,
  383. 'http://soundcloud.com/people/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  384. ));
  385. // 'http://soundcloud.com/groups/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  386. $this->assertEquals(array(
  387. ),$this->proceed_element_datas_api(
  388. $bux,
  389. 'http://soundcloud.com/groups/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
  390. ));
  391. /*
  392. * - jamendo.com
  393. */
  394. // 'http://www.jamendo.com/fr/list/a120468/6-00-am'
  395. $this->assertEquals(array(
  396. 'data_ref_id' => '120468',
  397. 'data_title' => '6:00 AM',
  398. 'data_type' => 'album',
  399. 'data_thumb_url' => 'http://imgjam.com/albums/s120/120468/covers/1.100.jpg',
  400. 'data_artist' => 'Azyd Azylum',
  401. 'data_tags' => array(
  402. 0 => 'Metal',
  403. 1 => 'Hardcore',
  404. 2 => 'Metalcore',
  405. 3 => 'Azyd',
  406. 4 => 'Azylum',
  407. ),
  408. 'data_download' => true,
  409. ),$this->proceed_element_datas_api(
  410. $bux,
  411. 'http://www.jamendo.com/fr/list/a120468/6-00-am'
  412. ));
  413. // 'http://www.jamendo.com/fr/track/207079'
  414. $this->assertEquals(array(
  415. 'data_ref_id' => '207079',
  416. 'data_title' => 'Insanity',
  417. 'data_type' => 'track',
  418. 'data_thumb_url' => 'http://imgjam.com/albums/s30/30661/covers/1.100.jpg',
  419. 'data_artist' => 'Ptit lutin',
  420. 'data_tags' => array(
  421. 0 => 'Techno',
  422. 1 => 'Hardtek'
  423. ),
  424. 'data_download' => true,
  425. ),$this->proceed_element_datas_api(
  426. $bux,
  427. 'http://www.jamendo.com/fr/track/207079'
  428. ));
  429. // 'http://www.jamendo.com/fr/search/all/psytrance'
  430. $this->assertEquals(array(
  431. 'data_ref_id' => null,
  432. 'data_type' => null,
  433. 'data_download' => true,
  434. ),$this->proceed_element_datas_api(
  435. $bux,
  436. 'http://www.jamendo.com/fr/search/all/psytrance'
  437. ));
  438. // 'http://www.jamendo.com/fr/artist/DJ_BETO'
  439. $this->assertEquals(array(
  440. 'data_ref_id' => null,
  441. 'data_type' => null,
  442. 'data_download' => true,
  443. ),$this->proceed_element_datas_api(
  444. $bux,
  445. 'http://www.jamendo.com/fr/artist/DJ_BETO'
  446. ));
  447. /*/*
  448. * - deezer.com
  449. */
  450. // 'http://www.deezer.com/fr/music/pantera/far-beyond-driven-80398'
  451. $this->assertEquals(array(
  452. 'data_ref_id' => '80398',
  453. 'data_type' => 'album',
  454. 'data_thumb_url' => 'http://api.deezer.com/2.0/album/80398/image',
  455. 'data_title' => 'Far Beyond Driven',
  456. 'data_artist' => 'Pantera'
  457. ),$this->proceed_element_datas_api(
  458. $bux,
  459. 'http://www.deezer.com/fr/music/pantera/far-beyond-driven-80398'
  460. ));
  461. // 'http://www.deezer.com/fr/music/playlist/18701350'
  462. $this->assertEquals(array(
  463. 'data_ref_id' => '18701350',
  464. 'data_type' => 'playlist',
  465. ),$this->proceed_element_datas_api(
  466. $bux,
  467. 'http://www.deezer.com/fr/music/playlist/18701350'
  468. ));
  469. /*
  470. * Vimeo
  471. *
  472. */
  473. $this->assertEquals(array(
  474. 'data_ref_id' => '43258820',
  475. 'data_title' => 'Punish Yourself',
  476. 'data_thumb_url' => 'http://b.vimeocdn.com/ts/301/282/301282081_200.jpg'
  477. ),$this->proceed_element_datas_api(
  478. $bux,
  479. 'http://vimeo.com/43258820'
  480. ));
  481. }
  482. }