Browse Source

Merge branch 'unstable' into feature/test

bastien 13 years ago
parent
commit
cec14d89f2

+ 1 - 1
src/Muzich/CoreBundle/Tests/Tag/TagReadTest.php View File

@@ -148,7 +148,7 @@ class TagReadTest extends UnitTest
148 148
     $paul = $this->getUser('paul');
149 149
     
150 150
     ////////////////////////////////
151
-    $rtags = array('Electro', 'Hardcore', 'Hardtek', 'Metal', 'Tribe');
151
+    $rtags = array('Electro', 'Hardcore', 'Hardtek', 'Metal');
152 152
     
153 153
     $tags = $this->getTagsNamesForQuery($this->getDoctrine()->getRepository('MuzichCoreBundle:User')
154 154
       ->getElementsTags($bux->getId())      

+ 24 - 0
src/Muzich/CoreBundle/Tests/Tag/TagWriteTest.php View File

@@ -17,6 +17,7 @@ class TagWriteTest extends UnitTest
17 17
   
18 18
   public function testAddTag()
19 19
   {
20
+    $this->clean();
20 21
     $bux = $this->getUser('bux');
21 22
     $paul = $this->getUser('paul');
22 23
     
@@ -76,10 +77,12 @@ class TagWriteTest extends UnitTest
76 77
       ))
77 78
     ;
78 79
     $this->assertTrue(!is_null($tag_database));
80
+    $this->clean();
79 81
   }
80 82
   
81 83
   public function testModerateTag()
82 84
   {
85
+    $this->clean();
83 86
     $bux = $this->getUser('bux');
84 87
     
85 88
     // Ajout de tags
@@ -308,6 +311,27 @@ class TagWriteTest extends UnitTest
308 311
       ))
309 312
     ;
310 313
     $this->assertTrue(!is_null($fav));
314
+    
315
+    $this->getDoctrine()->getEntityManager()->persist($tag_3);
316
+    $this->clean();
317
+  }
318
+  
319
+  protected function clean()
320
+  {
321
+    $tag1 = $this->getDoctrine()->getRepository('MuzichCoreBundle:Tag')
322
+      ->findOneByName('Nouveau 1');
323
+    $tag2 = $this->getDoctrine()->getRepository('MuzichCoreBundle:Tag')
324
+      ->findOneByName('Nouveau 2');
325
+    $tag3 = $this->getDoctrine()->getRepository('MuzichCoreBundle:Tag')
326
+      ->findOneByName('Nouveau 3');
327
+    $tag4 = $this->getDoctrine()->getRepository('MuzichCoreBundle:Tag')
328
+      ->findOneByName('Xvlsd aoj 12');
329
+    
330
+    ($tag1) ? $this->getDoctrine()->getEntityManager()->remove($tag1) : '';
331
+    ($tag2) ? $this->getDoctrine()->getEntityManager()->remove($tag2) : '';
332
+    ($tag3) ? $this->getDoctrine()->getEntityManager()->remove($tag3) : '';
333
+    ($tag4) ? $this->getDoctrine()->getEntityManager()->remove($tag4) : '';
334
+    $this->getDoctrine()->getEntityManager()->flush();
311 335
   }
312 336
   
313 337
 }

+ 1 - 1
web/bundles/muzichcore/js/muzich.js View File

@@ -1110,7 +1110,7 @@ $(document).ready(function(){
1110 1110
     // On construit notre liste de tags
1111 1111
     tags_ids = new Array();
1112 1112
     $('ul#favorite_tags a.tag.active').each(function(index){
1113
-      id = str_replace('#', '', link.attr('href'));
1113
+      id = str_replace('#', '', $(this).attr('href'));
1114 1114
       tags_ids[id] = id;
1115 1115
     });
1116 1116