Browse Source

fix tests for previous changes

Bastien Sevajol 11 years ago
parent
commit
07b360892d

+ 0 - 0
src/Muzich/CoreBundle/Form/Playlist/PrivateLinksForm.php View File


+ 1 - 1
src/Muzich/CoreBundle/Resources/config/security.yml View File

109
         - { path: ^/(?:fr|en)/user, role: IS_AUTHENTICATED_ANONYMOUSLY }
109
         - { path: ^/(?:fr|en)/user, role: IS_AUTHENTICATED_ANONYMOUSLY }
110
         - { path: ^/(?:fr|en)/group, role: IS_AUTHENTICATED_ANONYMOUSLY }
110
         - { path: ^/(?:fr|en)/group, role: IS_AUTHENTICATED_ANONYMOUSLY }
111
         - { path: ^/(?:fr|en)/search, role: IS_AUTHENTICATED_ANONYMOUSLY }
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
         - { path: ^/(?:fr|en)/my-groups/add, role: IS_AUTHENTICATED_ANONYMOUSLY }  
113
         - { path: ^/(?:fr|en)/my-groups/add, role: IS_AUTHENTICATED_ANONYMOUSLY }  
114
         - { path: ^/(?:fr|en)/song, role: IS_AUTHENTICATED_ANONYMOUSLY }                  
114
         - { path: ^/(?:fr|en)/song, role: IS_AUTHENTICATED_ANONYMOUSLY }                  
115
           
115
           

+ 0 - 11
src/Muzich/CoreBundle/Tests/Controller/FavoriteControllerTest.php View File

145
     
145
     
146
     $this->isResponseSuccess();
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
     // L'élément est présent sur la page
148
     // L'élément est présent sur la page
153
     $this->exist('li:contains("DUDELDRUM")');
149
     $this->exist('li:contains("DUDELDRUM")');
154
     $this->exist('a[href="'.($url = $this->generateUrl('favorite_add', array(
150
     $this->exist('a[href="'.($url = $this->generateUrl('favorite_add', array(
180
     
176
     
181
     $this->assertTrue(!is_null($favorite));
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
     // On se rend sur la page de ses favoris
179
     // On se rend sur la page de ses favoris
188
     $this->crawler = $this->client->request('GET', $this->generateUrl('favorites_my_list'));
180
     $this->crawler = $this->client->request('GET', $this->generateUrl('favorites_my_list'));
189
     
181
     
208
     
200
     
209
     $this->assertTrue(is_null($favorite));
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
   public function testAjax()
205
   public function testAjax()

+ 1 - 0
src/Muzich/CoreBundle/Tests/Controller/HomeControllerTest.php View File

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

+ 3 - 3
src/Muzich/CoreBundle/Tests/Controller/PlaylistControllerTest.php View File

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

+ 4 - 2
src/Muzich/CoreBundle/Tests/Searcher/ElementSearcherTest.php View File

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

+ 10 - 1
src/Muzich/CoreBundle/Tests/lib/Security/ContextTestCases.php View File

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

+ 3 - 3
src/Muzich/PlaylistBundle/Resources/config/routing.yml View File

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

+ 0 - 0
src/Muzich/PlaylistBundle/Resources/views/Edit/create.html.twig View File


+ 0 - 0
web/img/icon_star_2_gray.png View File