Browse Source

bug fix: test plus adapté a thumb de dound cloud changeant :/ et test de l'existance de la variable same_url dans le twig avant de l'utiliser.

Sevajol Bastien 12 years ago
parent
commit
a7a092d8c4

+ 29 - 10
src/Muzich/CoreBundle/Tests/ElementFactory/ElementFactoryTest.php View File

@@ -350,25 +350,47 @@ class ElementFactoryTest extends UnitTest
350 350
     
351 351
     // 'http://soundcloud.com/matas/sets/library-project'
352 352
     
353
+    // On retire le test de "data_thumb_url", chez sound cloud ca arrete pas de 
354
+    // changer en ce moment
355
+    
356
+    $datas = $this->proceed_element_datas_api(
357
+      $bux, 
358
+      'http://soundcloud.com/matas/sets/library-project'
359
+    );
360
+    
361
+    $this->assertTrue(array_key_exists('data_thumb_url', $datas));
362
+    
363
+    if (array_key_exists('data_thumb_url', $datas))
364
+    {
365
+      unset($datas['data_thumb_url']);
366
+    }
367
+    
353 368
     $this->assertEquals(array(
354 369
       'data_ref_id' => 3770,
355 370
       'data_title' => 'Library Project',
356
-      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?51826bf',
371
+      //'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?51826bf',
357 372
       'data_type' => 'playlist',
358 373
       'data_download' => null,
359 374
       'data_download_url' => 'http://soundcloud.com/matas/sets/library-project/download',
360 375
       'data_artist' => 'matas',
361
-    ),$this->proceed_element_datas_api(
362
-      $bux, 
363
-      'http://soundcloud.com/matas/sets/library-project'
364
-    ));
376
+    ),$datas);
365 377
     
366 378
     // 'http://soundcloud.com/matas/above-hyperion-redux'
379
+    $datas = $this->proceed_element_datas_api(
380
+      $bux, 
381
+      'http://soundcloud.com/matas/above-hyperion-redux'
382
+    );
383
+    
384
+    $this->assertTrue(array_key_exists('data_thumb_url', $datas));
367 385
     
386
+    if (array_key_exists('data_thumb_url', $datas))
387
+    {
388
+      unset($datas['data_thumb_url']);
389
+    }
368 390
     $this->assertEquals(array(
369 391
       'data_ref_id' => 3154252,
370 392
       'data_title' => 'Above Hyperion (redux)',
371
-      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000001536693-gb1n5v-large.jpg?51826bf',
393
+      //'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000001536693-gb1n5v-large.jpg?51826bf',
372 394
       'data_type' => 'track',
373 395
       'data_download' => false,
374 396
       'data_download_url' => 'http://soundcloud.com/matas/above-hyperion-redux/download',
@@ -376,10 +398,7 @@ class ElementFactoryTest extends UnitTest
376 398
       'data_tags' => array(
377 399
         0 => 'Spacestep'
378 400
       )
379
-    ),$this->proceed_element_datas_api(
380
-      $bux, 
381
-      'http://soundcloud.com/matas/above-hyperion-redux'
382
-    ));
401
+    ),$datas);
383 402
     
384 403
     // 'http://soundcloud.com/tracks/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D='
385 404
     

+ 2 - 0
src/Muzich/HomeBundle/Resources/views/Home/index.html.twig View File

@@ -45,6 +45,7 @@
45 45
         'form_name'     : add_form_name
46 46
       } %}
47 47
             
48
+    {% if from_url is defined %}
48 49
     {% if from_url %}
49 50
       <script type="text/javascript">
50 51
         $(document).ready(function(){
@@ -57,6 +58,7 @@
57 58
         });
58 59
       </script>
59 60
     {% endif %}
61
+    {% endif %}
60 62
 
61 63
     </form>
62 64
   </div>