Bladeren bron

fix tests for previous changes

Bastien Sevajol 11 jaren geleden
bovenliggende
commit
07b360892d

+ 0 - 0
src/Muzich/CoreBundle/Form/Playlist/PrivateLinksForm.php Bestand weergeven


+ 1 - 1
src/Muzich/CoreBundle/Resources/config/security.yml Bestand weergeven

@@ -109,7 +109,7 @@ security:
109 109
         - { path: ^/(?:fr|en)/user, role: IS_AUTHENTICATED_ANONYMOUSLY }
110 110
         - { path: ^/(?:fr|en)/group, role: IS_AUTHENTICATED_ANONYMOUSLY }
111 111
         - { path: ^/(?:fr|en)/search, role: IS_AUTHENTICATED_ANONYMOUSLY }
112
-        #- { path: ^/(?:fr|en)/playlist, role: IS_AUTHENTICATED_ANONYMOUSLY }
112
+        - { path: ^/(?:fr|en)/playlist, role: IS_AUTHENTICATED_ANONYMOUSLY }
113 113
         - { path: ^/(?:fr|en)/my-groups/add, role: IS_AUTHENTICATED_ANONYMOUSLY }  
114 114
         - { path: ^/(?:fr|en)/song, role: IS_AUTHENTICATED_ANONYMOUSLY }                  
115 115
           

+ 0 - 11
src/Muzich/CoreBundle/Tests/Controller/FavoriteControllerTest.php Bestand weergeven

@@ -145,10 +145,6 @@ class FavoriteControllerTest extends FunctionalTest
145 145
     
146 146
     $this->isResponseSuccess();
147 147
     
148
-    // Controle de l'évolution du score de joelle
149
-    $joelle = $this->getUser('joelle');
150
-    $this->assertEquals($joelle->getReputation(), 2);
151
-    
152 148
     // L'élément est présent sur la page
153 149
     $this->exist('li:contains("DUDELDRUM")');
154 150
     $this->exist('a[href="'.($url = $this->generateUrl('favorite_add', array(
@@ -180,10 +176,6 @@ class FavoriteControllerTest extends FunctionalTest
180 176
     
181 177
     $this->assertTrue(!is_null($favorite));
182 178
     
183
-    // Controle de l'évolution du score de joelle
184
-    $joelle = $this->getUser('joelle');
185
-    $this->assertEquals($joelle->getReputation(), 7);
186
-    
187 179
     // On se rend sur la page de ses favoris
188 180
     $this->crawler = $this->client->request('GET', $this->generateUrl('favorites_my_list'));
189 181
     
@@ -208,9 +200,6 @@ class FavoriteControllerTest extends FunctionalTest
208 200
     
209 201
     $this->assertTrue(is_null($favorite));
210 202
     
211
-    // Controle de l'évolution du score de joelle
212
-    $joelle = $this->getUser('joelle');
213
-    $this->assertEquals($joelle->getReputation(), 2);
214 203
   }
215 204
   
216 205
   public function testAjax()

+ 1 - 0
src/Muzich/CoreBundle/Tests/Controller/HomeControllerTest.php Bestand weergeven

@@ -61,6 +61,7 @@ class HomeControllerTest extends FunctionalTest
61 61
         'tag_strict'  => false,
62 62
         'string'      => null,
63 63
         'need_tags'   => false,
64
+        'display_privates' => false
64 65
     ), $this->getSession()->get('user.element_search.params'));
65 66
     
66 67
     // On fabrique l'ElementSearcher correspondant

+ 3 - 3
src/Muzich/CoreBundle/Tests/Controller/PlaylistControllerTest.php Bestand weergeven

@@ -60,19 +60,19 @@ class PlaylistControllerTest extends FunctionalTest
60 60
       true
61 61
     );
62 62
     
63
-    $this->security_context_test->testUserCantMakeActionStatus( 
63
+    $this->security_context_test->testUserCantMakeActionStatus(
64 64
       SecurityContext::ACTION_PLAYLIST_DELETE, 
65 65
       SecurityContext::CONDITION_USER_NOT_CONNECTED,
66 66
       true
67 67
     );
68 68
     
69
-    $this->security_context_test->testUserCantMakeActionStatus( 
69
+    $this->security_context_test->testUserCantMakeActionStatus(
70 70
       SecurityContext::ACTION_PLAYLIST_UNPICK, 
71 71
       SecurityContext::CONDITION_USER_NOT_CONNECTED,
72 72
       true
73 73
     );
74 74
     
75
-    $this->security_context_test->testUserCantMakeActionStatus( 
75
+    $this->security_context_test->testUserCantMakeActionStatus(
76 76
       SecurityContext::ACTION_PLAYLIST_PICK, 
77 77
       SecurityContext::CONDITION_USER_NOT_CONNECTED,
78 78
       true

+ 4 - 2
src/Muzich/CoreBundle/Tests/Searcher/ElementSearcherTest.php Bestand weergeven

@@ -21,7 +21,8 @@ class ElementSearcherTest extends UnitTest
21 21
         'ids_display' => null,
22 22
         'tag_strict' => false,
23 23
         'string'     => null,
24
-        'need_tags' => false
24
+        'need_tags' => false,
25
+        'display_privates' => false
25 26
     ));
26 27
 
27 28
     $this->assertEquals($ia, $es->getParams());
@@ -49,7 +50,8 @@ class ElementSearcherTest extends UnitTest
49 50
         'ids_display' => null,
50 51
         'tag_strict' => false,
51 52
         'string'     => null,
52
-        'need_tags' => false
53
+        'need_tags' => false,
54
+        'display_privates' => false
53 55
     ));
54 56
 
55 57
     $this->assertEquals($ua, $es->getParams());

+ 10 - 1
src/Muzich/CoreBundle/Tests/lib/Security/ContextTestCases.php Bestand weergeven

@@ -234,12 +234,18 @@ class ContextTestCases
234 234
   
235 235
   public function followUser($user_id)
236 236
   {
237
+    $token = 'notoken';
238
+    if ($this->test->getUser() instanceof User)
239
+    {
240
+      $token = $this->test->getUser()->getPersonalHash($user_id);
241
+    }
242
+    
237 243
     return $this->getAjaxRequestContentResponse(
238 244
       'GET',
239 245
       $this->test->generateUrl('follow', array(
240 246
         'type'  => 'user', 
241 247
         'id'    => $user_id,
242
-        'token' => $this->test->getUser()->getPersonalHash($user_id)
248
+        'token' => $token
243 249
       ))
244 250
     );
245 251
   }
@@ -413,7 +419,10 @@ class ContextTestCases
413 419
   
414 420
   public function playlistDeleteResponseIs($success, $condition)
415 421
   {
422
+    
423
+    
416 424
     $this->playlistDelete(0);
425
+    
417 426
     return $this->responseSatisfyConditions(
418 427
       $this->test->getClient()->getResponse(), 
419 428
       $success, 

+ 3 - 3
src/Muzich/PlaylistBundle/Resources/config/routing.yml Bestand weergeven

@@ -21,15 +21,15 @@ playlist_update:
21 21
   defaults: { _controller: MuzichPlaylistBundle:Edit:update }
22 22
 
23 23
 playlist_delete:
24
-  pattern: /private/playlist/delete/{playlist_id}/{token}
24
+  pattern: /playlist/delete/{playlist_id}/{token}
25 25
   defaults: { _controller: MuzichPlaylistBundle:Edit:delete }
26 26
 
27 27
 playlist_unpick:
28
-  pattern: /private/playlist/unpick/{playlist_id}/{token}/{redirect_owner}
28
+  pattern: /playlist/unpick/{playlist_id}/{token}/{redirect_owner}
29 29
   defaults: { _controller: MuzichPlaylistBundle:Edit:unpick, redirect_owner: false }
30 30
 
31 31
 playlist_pick:
32
-  pattern: /private/playlist/pick/{playlist_id}/{token}/{redirect_owner}
32
+  pattern: /playlist/pick/{playlist_id}/{token}/{redirect_owner}
33 33
   defaults: { _controller: MuzichPlaylistBundle:Edit:pick, redirect_owner: false }
34 34
 
35 35
 playlist_add_private_links:

+ 0 - 0
src/Muzich/PlaylistBundle/Resources/views/Edit/create.html.twig Bestand weergeven


+ 0 - 0
web/img/icon_star_2_gray.png Bestand weergeven