@@ -54,7 +54,7 @@ public function testIndexAction()
54
54
55
55
foreach ($ resp ->results as $ result )
56
56
{
57
- $ this ->assertTrue ($ result ->resultType == 'user ' || $ result ->resultType == 'folder ' || $ result ->resultType =='item ' );
57
+ $ this ->assertTrue ($ result ->resultType == 'user ' || $ result ->resultType == 'folder ' || $ result ->resultType == 'item ' );
58
58
59
59
switch ($ result ->resultType )
60
60
{
@@ -66,6 +66,7 @@ public function testIndexAction()
66
66
case 'folder ' :
67
67
$ this ->assertTrue (is_numeric ($ result ->folder_id ));
68
68
$ this ->assertNotEmpty ($ result ->name );
69
+ break ;
69
70
case 'item ' :
70
71
break ;
71
72
default :
@@ -84,20 +85,28 @@ public function testLiveSearch()
84
85
85
86
$ resp = json_decode ($ this ->getBody ());
86
87
87
- // Ensure we get item and user results from live search
88
- $ this ->assertEquals (count ($ resp ), 4 );
89
- $ this ->assertEquals ($ resp [0 ]->category , 'Folders ' );
90
- $ this ->assertNotEmpty ($ resp [0 ]->value );
91
- $ this ->assertTrue (is_numeric ($ resp [0 ]->folderid ));
92
- $ this ->assertEquals ($ resp [1 ]->category , 'Folders ' );
93
- $ this ->assertNotEmpty ($ resp [1 ]->value );
94
- $ this ->assertTrue (is_numeric ($ resp [1 ]->folderid ));
95
- $ this ->assertEquals ($ resp [2 ]->category , 'Users ' );
96
- $ this ->assertNotEmpty ($ resp [2 ]->value );
97
- $ this ->assertTrue (is_numeric ($ resp [2 ]->userid ));
98
- $ this ->assertEquals ($ resp [3 ]->category , 'Users ' );
99
- $ this ->assertNotEmpty ($ resp [3 ]->value );
100
- $ this ->assertTrue (is_numeric ($ resp [3 ]->userid ));
88
+ // Ensure we get folder and user results from live search
89
+ $ this ->assertTrue (count ($ resp ) >= 4 );
90
+ foreach ($ resp as $ result )
91
+ {
92
+ $ this ->assertTrue ($ result ->category == 'Users ' || $ result ->category == 'Folders ' || $ result ->category == 'Items ' );
93
+
94
+ switch ($ result ->category )
95
+ {
96
+ case 'Users ' :
97
+ $ this ->assertTrue (is_numeric ($ result ->userid ));
98
+ $ this ->assertNotEmpty ($ result ->value );
99
+ break ;
100
+ case 'Folders ' :
101
+ $ this ->assertTrue (is_numeric ($ result ->folderid ));
102
+ $ this ->assertNotEmpty ($ result ->value );
103
+ break ;
104
+ case 'Items ' :
105
+ break ;
106
+ default :
107
+ break ;
108
+ }
109
+ }
101
110
102
111
// Ensure we get community results from live search
103
112
$ this ->resetAll ();
0 commit comments