Browse Source

Evolution #166: La recherche

bastien 12 years ago
parent
commit
50e9becf65

+ 10 - 7
src/Muzich/CoreBundle/Tests/Controller/MynetworkControllerTest.php View File

@@ -43,14 +43,8 @@ class MynetworkControllerTest extends FunctionalTest
43 43
   {
44 44
     $this->client = self::createClient();
45 45
     $this->connectUser('bux', 'toor');
46
-    $link = $this->selectLink('a[href="'.$this->generateUrl('mynetwork_index').'"]');
47
-    $this->clickOnLink($link);
48
-    $this->isResponseSuccess();
49
-    $link = $this->selectLink('a[href="'.$this->generateUrl('mynetwork_search').'"]');
50
-    $this->clickOnLink($link);
51
-    $this->isResponseSuccess();
52 46
     
53
-    $this->exist('form[action="'.($url = $this->generateUrl('mynetwork_search')).'"]');
47
+    $this->exist('form[action="'.($url = $this->generateUrl('global_search')).'"]');
54 48
     $this->exist('form[action="'.$url.'"] input[id="form_string"]');
55 49
     $this->exist('form[action="'.$url.'"] input[type="submit"]');
56 50
     
@@ -76,6 +70,15 @@ class MynetworkControllerTest extends FunctionalTest
76 70
     // On trouve joelle mais aussi son groupe (il y a joelle dans le nom)
77 71
     $this->exist('ul#search_users li a[href="'.$this->generateUrl('show_user', array('slug' => $joelle->getSlug())).'"]');
78 72
     $this->exist('ul#search_groups li a[href="'.$this->generateUrl('show_group', array('slug' => $Le_groupe_de_joelle->getSlug())).'"]');
73
+  
74
+    // On cherche des éléments
75
+    $form = $this->selectForm('form[action="'.$url.'"] input[type="submit"]');
76
+    $form['form[string]'] = 'har';
77
+    $this->submit($form);
78
+    $this->isResponseSuccess();
79
+    
80
+    $this->exist('span.element_name:contains("Ed Cox - La fanfare des teuffeurs (Hardcordian)")');
81
+    $this->exist('span.element_name:contains("Acrotek Hardtek G01")');
79 82
   }
80 83
   
81 84
   /**

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

@@ -19,7 +19,8 @@ class ElementSearcherTest extends UnitTest
19 19
         'favorite'  => false,
20 20
         'ids'       => null,
21 21
         'ids_display' => null,
22
-        'tag_strict' => false
22
+        'tag_strict' => false,
23
+        'string'     => null
23 24
     ));
24 25
 
25 26
     $this->assertEquals($ia, $es->getParams());
@@ -45,7 +46,8 @@ class ElementSearcherTest extends UnitTest
45 46
         'favorite'  => false,
46 47
         'ids'       => null,
47 48
         'ids_display' => null,
48
-        'tag_strict' => false
49
+        'tag_strict' => false,
50
+        'string'     => null
49 51
     ));
50 52
 
51 53
     $this->assertEquals($ua, $es->getParams());