bastien 13 years ago
parent
commit
9dd0a32695
1 changed files with 45 additions and 0 deletions
  1. 45 0
      src/Muzich/CoreBundle/Tests/Controller/HomeControllerTest.php

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

@@ -221,6 +221,51 @@ class HomeControllerTest extends FunctionalTest
221 221
     ;
222 222
     $this->assertTrue(is_null($element));
223 223
     
224
+    // url non conforme
225
+    $this->procedure_add_element(
226
+      'Mon bel element 789e', 
227
+      'http://', 
228
+      array($hardtek->getId(), $tribe->getId())
229
+    );
230
+    
231
+    $this->isResponseSuccess();
232
+    
233
+    $this->notExist('li:contains("Mon bel element 789e")');
234
+    $element = $this->getDoctrine()->getRepository('MuzichCoreBundle:Element')
235
+      ->findOneByName('Mon bel element 789e')
236
+    ;
237
+    $this->assertTrue(is_null($element));
238
+    
239
+    // url non conforme
240
+    $this->procedure_add_element(
241
+      'Mon bel element 789f', 
242
+      'http://youtube', 
243
+      array($hardtek->getId(), $tribe->getId())
244
+    );
245
+    
246
+    $this->isResponseSuccess();
247
+    
248
+    $this->notExist('li:contains("Mon bel element 789f")');
249
+    $element = $this->getDoctrine()->getRepository('MuzichCoreBundle:Element')
250
+      ->findOneByName('Mon bel element 789f')
251
+    ;
252
+    $this->assertTrue(is_null($element));
253
+    
254
+    // url non conforme
255
+    $this->procedure_add_element(
256
+      'Mon bel element 789g', 
257
+      'youtube.com?lalala', 
258
+      array($hardtek->getId(), $tribe->getId())
259
+    );
260
+    
261
+    $this->isResponseSuccess();
262
+    
263
+    $this->notExist('li:contains("Mon bel element 789g")');
264
+    $element = $this->getDoctrine()->getRepository('MuzichCoreBundle:Element')
265
+      ->findOneByName('Mon bel element 789g')
266
+    ;
267
+    $this->assertTrue(is_null($element));
268
+    
224 269
     // Pas de nom
225 270
     $this->procedure_add_element(
226 271
       '',