From 4894915d57060d8c0ec2941c2f5164c0bbb9e4d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 28 Apr 2010 20:44:33 +0200 Subject: [PATCH] Add ut for UFC_EducationDegree MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- ut/userfiltertest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ut/userfiltertest.php b/ut/userfiltertest.php index 6b4db76..bf15f30 100644 --- a/ut/userfiltertest.php +++ b/ut/userfiltertest.php @@ -254,6 +254,29 @@ class UserFilterTest extends PlTestCase new UFC_EducationSchool(array($id_X, $id_HEC)), -1), ); + /* UFC_EducationDegree + */ + $id_DegreeIng = XDB::fetchOneCell('SELECT id + FROM profile_education_degree_enum + WHERE abbreviation = {?}', 'Ing.'); + $id_DegreePhd = XDB::fetchOneCell('SELECT id + FROM profile_education_degree_enum + WHERE abbreviation = {?}', 'PhD'); + $tests[] = array( + array(XDB::format('SELECT DISTINCT ap.uid + FROM account_profiles AS ap + INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms)) + LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id) + WHERE pede.abbreviation = {?}', 'Ing.'), + new UFC_EducationDegree($id_DegreeIng), -1), + array(XDB::format('SELECT DISTINCT ap.uid + FROM account_profiles AS ap + INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms)) + LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id) + WHERE pede.abbreviation IN {?}', array('Ing.', 'PhD')), + new UFC_EducationDegree(array($id_DegreeIng, $id_DegreePhd)), -1), + ); + $testcases = array(); foreach ($tests as $t) { $testcases = array_merge($testcases, $t); -- 2.1.4