Add partial tests for UFC_Name
[platal.git] / ut / userfiltertest.php
1 <?php
2 /***************************************************************************
3 * Copyright (C) 2003-2010 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
21
22 require_once dirname(__FILE__) . '/../include/test.inc.php';
23
24 class UserFilterTest extends PlTestCase
25 {
26 private static function checkPlatal()
27 {
28 global $platal;
29 if($platal == null)
30 {
31 $platal = new Xorg();
32 }
33 }
34
35 public static function simpleUserProvider()
36 {
37 self::checkPlatal();
38 $tests = array();
39
40 $tests[] = array(
41 /* UFC_Hrpid
42 */
43 array('SELECT DISTINCT uid
44 FROM account_profiles
45 WHERE FIND_IN_SET(\'owner\', perms)',
46 new UFC_HasProfile(), -1),
47
48 /* UFC_Hruid
49 */
50 array(XDB::format('SELECT DISTINCT uid
51 FROM accounts
52 WHERE hruid = {?}', 'florent.bruneau.2003'),
53 new UFC_Hruid('florent.bruneau.2003'), 1),
54 array(XDB::format('SELECT DISTINCT uid
55 FROM accounts
56 WHERE hruid = {?}', 'florent.bruneau.2004'),
57 new UFC_Hruid('florent.bruneau.2004'), 0),
58 array(XDB::format('SELECT DISTINCT uid
59 FROM accounts
60 WHERE hruid IN {?}', array('florent.bruneau.2003',
61 'stephane.jacob.2004')),
62 new UFC_Hruid('florent.bruneau.2003', 'stephane.jacob.2004'), 2),
63 array(XDB::format('SELECT DISTINCT uid
64 FROM accounts
65 WHERE hruid IN {?}', array('florent.bruneau.2004',
66 'stephane.jacob.2004')),
67 new UFC_Hruid('florent.bruneau.2004', 'stephane.jacob.2004'), 1),
68
69 /* UFC_Hrpid
70 */
71 array(XDB::format('SELECT DISTINCT uid
72 FROM account_profiles AS ap
73 INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
74 WHERE hrpid = {?}', 'florent.bruneau.2003'),
75 new UFC_Hrpid('florent.bruneau.2003'), 1),
76 array(XDB::format('SELECT DISTINCT uid
77 FROM account_profiles AS ap
78 INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
79 WHERE hrpid = {?}', 'florent.bruneau.2004'),
80 new UFC_Hrpid('florent.bruneau.2004'), 0),
81 array(XDB::format('SELECT DISTINCT uid
82 FROM account_profiles AS ap
83 INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
84 WHERE hrpid IN {?}', array('florent.bruneau.2003',
85 'stephane.jacob.2004')),
86 new UFC_Hrpid('florent.bruneau.2003', 'stephane.jacob.2004'), 2),
87 array(XDB::format('SELECT DISTINCT uid
88 FROM account_profiles AS ap
89 INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
90 WHERE hrpid IN {?}', array('florent.bruneau.2004',
91 'stephane.jacob.2004')),
92 new UFC_Hrpid('florent.bruneau.2004', 'stephane.jacob.2004'), 1),
93
94 /* UFC_IP
95 */
96 array(XDB::format('SELECT DISTINCT a.uid
97 FROM log_sessions
98 INNER JOIN accounts AS a USING(uid)
99 WHERE ip = {?} OR forward_ip = {?}',
100 ip_to_uint('129.104.247.2'), ip_to_uint('129.104.247.2')),
101 new UFC_Ip('129.104.247.2'), -1),
102 );
103 /* TODO: UFC_Comment
104 */
105
106 /* UFC_Promo
107 */
108 $tests[] = array(
109 array(XDB::format('SELECT DISTINCT ap.uid
110 FROM account_profiles AS ap
111 INNER JOIN profile_display AS pd ON (pd.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
112 WHERE pd.promo = {?}', 'X2004'),
113 new UFC_Promo('=', UserFilter::DISPLAY, 'X2004'), -1),
114 array(XDB::format('SELECT DISTINCT ap.uid
115 FROM account_profiles AS ap
116 INNER JOIN profile_display AS pd ON (pd.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
117 WHERE pd.promo < {?}', 'X2004'),
118 new UFC_Promo('<', UserFilter::DISPLAY, 'X2004'), -1),
119 array(XDB::format('SELECT DISTINCT ap.uid
120 FROM account_profiles AS ap
121 INNER JOIN profile_display AS pd ON (pd.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
122 WHERE pd.promo > {?}', 'X2004'),
123 new UFC_Promo('>', UserFilter::DISPLAY, 'X2004'), -1),
124 array(XDB::format('SELECT DISTINCT ap.uid
125 FROM account_profiles AS ap
126 INNER JOIN profile_display AS pd ON (pd.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
127 WHERE pd.promo < {?}', 'X1900'),
128 new UFC_Promo('<', UserFilter::DISPLAY, 'X1900'), 0),
129
130 array(XDB::format('SELECT DISTINCT ap.uid
131 FROM account_profiles AS ap
132 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
133 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
134 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
135 WHERE pe.entry_year = {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
136 '2004', 'Ing.'),
137 new UFC_Promo('=', UserFilter::GRADE_ING, 2004), -1),
138 array(XDB::format('SELECT DISTINCT ap.uid
139 FROM account_profiles AS ap
140 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
141 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
142 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
143 WHERE pe.entry_year <= {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
144 '1960', 'Ing.'),
145 new UFC_Promo('<=', UserFilter::GRADE_ING, 1960), -1),
146 array(XDB::format('SELECT DISTINCT ap.uid
147 FROM account_profiles AS ap
148 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
149 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
150 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
151 WHERE pe.entry_year > {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
152 '2004', 'Ing.'),
153 new UFC_Promo('>', UserFilter::GRADE_ING, 2004), -1),
154 array(XDB::format('SELECT DISTINCT ap.uid
155 FROM account_profiles AS ap
156 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
157 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
158 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
159 WHERE pe.entry_year < {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
160 '1900', 'Ing.'),
161 new UFC_Promo('<', UserFilter::GRADE_ING, 1900), 0),
162
163 /* XXX : tests disabled until there are Masters and doctors in the DB
164 array(XDB::format('SELECT DISTINCT ap.uid
165 FROM account_profiles AS ap
166 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
167 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
168 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
169 WHERE pe.grad_year = {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
170 '2009', 'MSc'),
171 new UFC_Promo('=', UserFilter::GRADE_MST, 2009), -1),
172 array(XDB::format('SELECT DISTINCT ap.uid
173 FROM account_profiles AS ap
174 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
175 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
176 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
177 WHERE pe.grad_year <= {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
178 '2009', 'MSc'),
179 new UFC_Promo('<=', UserFilter::GRADE_MST, 2009), -1),
180 array(XDB::format('SELECT DISTINCT ap.uid
181 FROM account_profiles AS ap
182 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
183 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
184 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
185 WHERE pe.grad_year > {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
186 '2009', 'MSc'),
187 new UFC_Promo('>', UserFilter::GRADE_MST, 2009), -1),
188 array(XDB::format('SELECT DISTINCT ap.uid
189 FROM account_profiles AS ap
190 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
191 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
192 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
193 WHERE pe.grad_year < {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
194 '1980', 'MSc'),
195 new UFC_Promo('<', UserFilter::GRADE_MST, 1980), 0),
196
197 array(XDB::format('SELECT DISTINCT ap.uid
198 FROM account_profiles AS ap
199 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
200 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
201 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
202 WHERE pe.grad_year = {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
203 '2009', 'PhD'),
204 new UFC_Promo('=', UserFilter::GRADE_PHD, 2009), -1),
205 array(XDB::format('SELECT DISTINCT ap.uid
206 FROM account_profiles AS ap
207 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
208 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
209 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
210 WHERE pe.grad_year <= {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
211 '2009', 'PhD'),
212 new UFC_Promo('<=', UserFilter::GRADE_PHD, 2009), -1),
213 array(XDB::format('SELECT DISTINCT ap.uid
214 FROM account_profiles AS ap
215 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
216 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
217 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
218 WHERE pe.grad_year > {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
219 '2009', 'PhD'),
220 new UFC_Promo('>', UserFilter::GRADE_PHD, 2009), -1),
221 array(XDB::format('SELECT DISTINCT ap.uid
222 FROM account_profiles AS ap
223 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
224 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
225 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
226 WHERE pe.grad_year < {?} AND pee.abbreviation = \'X\' AND pede.abbreviation = {?}',
227 '1980', 'PhD'),
228 new UFC_Promo('<', UserFilter::GRADE_PHD, 1980), 0),
229 */
230 );
231
232 /* TODO: UFC_SchoolId
233 */
234 /* UFC_EducationSchool
235 */
236 $id_X = XDB::fetchOneCell('SELECT id
237 FROM profile_education_enum
238 WHERE abbreviation = {?}', 'X');
239 $id_HEC = XDB::fetchOneCell('SELECT id
240 FROM profile_education_enum
241 WHERE abbreviation = {?}', 'HEC');
242 $tests[] = array(
243 array(XDB::format('SELECT DISTINCT ap.uid
244 FROM account_profiles AS ap
245 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
246 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
247 WHERE pee.abbreviation = {?}', 'X'),
248 new UFC_EducationSchool($id_X), -1),
249 array(XDB::format('SELECT DISTINCT ap.uid
250 FROM account_profiles AS ap
251 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
252 LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
253 WHERE pee.abbreviation IN {?}', array('X', 'HEC')),
254 new UFC_EducationSchool($id_X, $id_HEC), -1),
255 );
256
257 /* UFC_EducationDegree
258 */
259 $id_DegreeIng = XDB::fetchOneCell('SELECT id
260 FROM profile_education_degree_enum
261 WHERE abbreviation = {?}', 'Ing.');
262 $id_DegreePhd = XDB::fetchOneCell('SELECT id
263 FROM profile_education_degree_enum
264 WHERE abbreviation = {?}', 'PhD');
265 $tests[] = array(
266 array(XDB::format('SELECT DISTINCT ap.uid
267 FROM account_profiles AS ap
268 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
269 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
270 WHERE pede.abbreviation = {?}', 'Ing.'),
271 new UFC_EducationDegree($id_DegreeIng), -1),
272 array(XDB::format('SELECT DISTINCT ap.uid
273 FROM account_profiles AS ap
274 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
275 LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
276 WHERE pede.abbreviation IN {?}', array('Ing.', 'PhD')),
277 new UFC_EducationDegree($id_DegreeIng, $id_DegreePhd), -1),
278 );
279 /* UFC_EducationField
280 */
281 $id_FieldInfo = XDB::fetchOneCell('SELECT id
282 FROM profile_education_field_enum
283 WHERE field = {?}', 'Informatique');
284 $id_FieldDroit = XDB::fetchOneCell('SELECT id
285 FROM profile_education_field_enum
286 WHERE field = {?}', 'Droit');
287 // FIXME: Replace 0 by -1 in following queries when profile_education will be filled with fieldids
288 $tests[] = array(
289 array(XDB::format('SELECT DISTINCT ap.uid
290 FROM account_profiles AS ap
291 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
292 LEFT JOIN profile_education_field_enum AS pefe ON (pe.fieldid = pefe.id)
293 WHERE pefe.field = {?}', 'Informatique'),
294 new UFC_EducationField($id_FieldInfo), 0), // FIXME: should be -1
295 array(XDB::format('SELECT DISTINCT ap.uid
296 FROM account_profiles AS ap
297 INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
298 LEFT JOIN profile_education_field_enum AS pefe ON (pe.fieldid = pefe.id)
299 WHERE pefe.field IN {?}', array('Informatique', 'Droit')),
300 new UFC_EducationField($id_FieldInfo, $id_FieldDroit), 0), // FIXME: should be -1
301 );
302
303 /* UFC_Name
304 */
305 $id_Lastname = DirEnum::getID(DirEnum::NAMETYPES, Profile::LASTNAME);
306 $id_Firstname = DirEnum::getID(DirEnum::NAMETYPES, Profile::FIRSTNAME);
307 $tests[] = array(
308 array(XDB::format('SELECT DISTINCT ap.uid
309 FROM account_profiles AS ap
310 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
311 WHERE pn.name LIKE {?} AND pn.typeid = {?}', 'BARROIS', $id_Lastname),
312 new UFC_Name(Profile::LASTNAME, 'BARROIS', UFC_Name::EXACT), -1),
313 array(XDB::format('SELECT DISTINCT ap.uid
314 FROM account_profiles AS ap
315 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
316 WHERE pn.name LIKE \'BARR%\' AND pn.typeid = {?}', $id_Lastname),
317 new UFC_Name(Profile::LASTNAME, 'BARR', UFC_Name::PREFIX), -1),
318 array(XDB::format('SELECT DISTINCT ap.uid
319 FROM account_profiles AS ap
320 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
321 WHERE pn.name LIKE \'%OIS\' AND pn.typeid = {?}', $id_Lastname),
322 new UFC_Name(Profile::LASTNAME, 'OIS', UFC_Name::SUFFIX), -1),
323 array(XDB::format('SELECT DISTINCT ap.uid
324 FROM account_profiles AS ap
325 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
326 WHERE pn.name LIKE \'%ARRO%\' AND pn.typeid = {?}', $id_Lastname),
327 new UFC_Name(Profile::LASTNAME, 'ARRO', UFC_Name::CONTAINS), -1),
328 array(XDB::format('SELECT DISTINCT ap.uid
329 FROM account_profiles AS ap
330 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
331 WHERE pn.name LIKE \'%ZZZZZZ%\' AND pn.typeid = {?}', $id_Lastname),
332 new UFC_Name(Profile::LASTNAME, 'ZZZZZZ', UFC_Name::CONTAINS), 0),
333
334 array(XDB::format('SELECT DISTINCT ap.uid
335 FROM account_profiles AS ap
336 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
337 WHERE pn.name LIKE {?} AND pn.typeid = {?}', 'Raphaël', $id_Firstname),
338 new UFC_Name(Profile::FIRSTNAME, 'Raphaël', UFC_Name::EXACT), -1),
339 array(XDB::format('SELECT DISTINCT ap.uid
340 FROM account_profiles AS ap
341 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
342 WHERE pn.name LIKE \'Raph%\' AND pn.typeid = {?}', $id_Firstname),
343 new UFC_Name(Profile::FIRSTNAME, 'Raph', UFC_Name::PREFIX), -1),
344 array(XDB::format('SELECT DISTINCT ap.uid
345 FROM account_profiles AS ap
346 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
347 WHERE pn.name LIKE \'%aël\' AND pn.typeid = {?}', $id_Firstname),
348 new UFC_Name(Profile::FIRSTNAME, 'aël', UFC_Name::SUFFIX), -1),
349 array(XDB::format('SELECT DISTINCT ap.uid
350 FROM account_profiles AS ap
351 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
352 WHERE pn.name LIKE \'%apha%\' AND pn.typeid = {?}', $id_Firstname),
353 new UFC_Name(Profile::FIRSTNAME, 'apha', UFC_Name::CONTAINS), -1),
354 array(XDB::format('SELECT DISTINCT ap.uid
355 FROM account_profiles AS ap
356 LEFT JOIN profile_name AS pn ON (ap.pid = pn.pid AND FIND_IN_SET(\'owner\', ap.perms))
357 WHERE pn.name LIKE \'%zzzzzz%\' AND pn.typeid = {?}', $id_Firstname),
358 new UFC_Name(Profile::FIRSTNAME, 'zzzzzz', UFC_Name::CONTAINS), 0),
359 );
360
361 $testcases = array();
362 foreach ($tests as $t) {
363 $testcases = array_merge($testcases, $t);
364 }
365 return $testcases;
366 }
367
368 /**
369 * @dataProvider simpleUserProvider
370 */
371 public function testSimpleUser($query, $cond, $expcount = null)
372 {
373 /*
374 * @param $query A MySQL query
375 * @param $cond The UFC to test
376 * @param $expcount The expected number of results (-1 if that number is unknown)
377 */
378
379 self::checkPlatal();
380
381 $query = XDB::query($query);
382 $count = $query->numRows();
383 if (!is_null($expcount)) {
384 if ($expcount < 0) {
385 $this->assertNotEquals(0, $count);
386 } else {
387 $this->assertEquals($expcount, $count);
388 }
389 }
390 $ids = $query->fetchColumn();
391 $this->assertEquals($count, count($ids));
392 sort($ids);
393
394 $uf = new UserFilter($cond);
395 $this->assertEquals($count, $uf->getTotalUserCount());
396 $got = $uf->getUIDs();
397 $this->assertEquals($count, count($got));
398 sort($got);
399 $this->assertEquals($ids, $got);
400
401 $uf = new UserFilter($cond);
402 $got = $uf->getUIDs();
403 $this->assertEquals($count, count($got));
404 sort($got);
405 $this->assertEquals($ids, $got);
406 $this->assertEquals($count, $uf->getTotalCount());
407 }
408 }
409
410 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
411 ?>