Add UTs for UFC_SchoolId
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 7 May 2010 10:49:11 +0000 (12:49 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 7 May 2010 10:49:11 +0000 (12:49 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
ut/userfiltertest.php

index 8f0baca..5e18956 100644 (file)
@@ -218,8 +218,24 @@ class UserFilterTest extends PlTestCase
              */
         );
 
-            /* TODO: UFC_SchoolId
+            /* UFC_SchoolId
              */
+        $tests[] = array(
+            array(self::buildProfileQuery('WHERE  p.xorg_id = {?}', 20060076),
+                new UFC_SchoolId(UFC_SchoolId::Xorg, 20060076), 1),
+            array(self::buildProfileQuery('WHERE  p.ax_id = {?}', 20060062),
+                new UFC_SchoolId(UFC_SchoolId::AX, 20060062), 1),
+            array(self::buildProfileQuery('WHERE  p.xorg_id = {?}', 007),
+                new UFC_SchoolId(UFC_SchoolId::Xorg, 007), 0),
+            array(self::buildProfileQuery('WHERE  p.ax_id = {?}', 007),
+                new UFC_SchoolId(UFC_SchoolId::AX, 007), 0),
+            /* FIXME: disabled until we have some examples of school_id
+            array(self::buildProfileQuery('WHERE  p.school_id = {?}', 12345678),
+                new UFC_SchoolId(UFC_SchoolId::School, 12345678), 1),
+            array(self::buildProfileQuery('WHERE  p.school_id = {?}', 007),
+                new UFC_SchoolId(UFC_SchoolId::School, 007), 0),
+             */
+        );
             /* UFC_EducationSchool
              */
         $id_X = XDB::fetchOneCell('SELECT  id