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
   {
43
   {
44
     $this->client = self::createClient();
44
     $this->client = self::createClient();
45
     $this->connectUser('bux', 'toor');
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
     $this->exist('form[action="'.$url.'"] input[id="form_string"]');
48
     $this->exist('form[action="'.$url.'"] input[id="form_string"]');
55
     $this->exist('form[action="'.$url.'"] input[type="submit"]');
49
     $this->exist('form[action="'.$url.'"] input[type="submit"]');
56
     
50
     
76
     // On trouve joelle mais aussi son groupe (il y a joelle dans le nom)
70
     // On trouve joelle mais aussi son groupe (il y a joelle dans le nom)
77
     $this->exist('ul#search_users li a[href="'.$this->generateUrl('show_user', array('slug' => $joelle->getSlug())).'"]');
71
     $this->exist('ul#search_users li a[href="'.$this->generateUrl('show_user', array('slug' => $joelle->getSlug())).'"]');
78
     $this->exist('ul#search_groups li a[href="'.$this->generateUrl('show_group', array('slug' => $Le_groupe_de_joelle->getSlug())).'"]');
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
         'favorite'  => false,
19
         'favorite'  => false,
20
         'ids'       => null,
20
         'ids'       => null,
21
         'ids_display' => null,
21
         'ids_display' => null,
22
-        'tag_strict' => false
22
+        'tag_strict' => false,
23
+        'string'     => null
23
     ));
24
     ));
24
 
25
 
25
     $this->assertEquals($ia, $es->getParams());
26
     $this->assertEquals($ia, $es->getParams());
45
         'favorite'  => false,
46
         'favorite'  => false,
46
         'ids'       => null,
47
         'ids'       => null,
47
         'ids_display' => null,
48
         'ids_display' => null,
48
-        'tag_strict' => false
49
+        'tag_strict' => false,
50
+        'string'     => null
49
     ));
51
     ));
50
 
52
 
51
     $this->assertEquals($ua, $es->getParams());
53
     $this->assertEquals($ua, $es->getParams());