13 require_once
'PU_testcase_dcp_commonfamily.php';
26 "PU_data_dcp_profil_family.ods",
27 "PU_data_dcp_profildata.ods"
39 $this->assertTrue($df->isAlive() ,
"document $docName is not alive");
40 $df->setProfil($prfName);
41 foreach ($aclAttendees as $acl => $expect) {
42 $result = ($df->Control($acl) ==
"");
44 $this->assertTrue($result,
"acl $acl is not granted");
46 $this->assertFalse($result,
"acl $acl is granted");
58 $this->assertTrue($df->isAlive() ,
"document $docName is not alive");
59 $df->setProfil($prfName);
67 foreach ($aclAttendees as $acl => $expect) {
68 $result = ($df->Control($acl) ==
"");
70 $this->assertTrue($result,
"acl $acl is not granted");
72 $this->assertFalse($result,
"acl $acl is granted");
84 $this->assertTrue($df->isAlive() ,
"document $docName is not alive");
85 $df->setProfil($prfName);
93 foreach ($aclAttendees as $acl => $expect) {
94 $result = ($df->Control($acl) ==
"");
96 $this->assertTrue($result,
"acl $acl is not granted");
98 $this->assertFalse($result,
"acl $acl is granted");
116 $this->assertEquals($expectNumber,
$s->count() , sprintf(
"query:%s: %s", print_r(
$s->getSearchInfo() ,
true) , print_r($this->getViews($famName) ,
true)));
124 simpleQuery(
'', sprintf(
'DELETE FROM dochisto WHERE id = %d', $profile->initid));
128 $histo = $profile->getHisto();
129 $hasRecomputedProfileedDocuments =
false;
130 foreach ($histo as $entry) {
131 if ($entry[
'code'] ==
'RECOMPUTE_PROFILED_DOCUMENT') {
132 $hasRecomputedProfileedDocuments =
true;
136 $msg = sprintf(
"Import of profile '%s' has wrongfully %srecomputed profiled documents.",
$data[
'profile'],
$data[
'recomputed'] ?
'not ' :
'');
137 $this->assertEquals(
$data[
'recomputed'], $hasRecomputedProfileedDocuments, $msg);
148 "import" =>
"PROFIL;TST_PRF_RESET;;RESET;view=TST_GRPALL;edit=TST_GRPSUBONE",
149 "profile" =>
"TST_PRF_RESET",
155 "import" =>
"PROFIL;TST_PRF_RESET;;RESET;view=TST_GRPALL;delete=TST_GRPSUBONE",
156 "profile" =>
"TST_PRF_RESET",
163 "import" =>
"PROFIL;TST_PRF_SET;;SET;view=TST_GRPALL;edit=TST_GRPSUBONE",
164 "profile" =>
"TST_PRF_SET",
165 "recomputed" =>
false
170 "import" =>
"PROFIL;TST_PRF_SET;;SET;view=TST_GRPALL;delete=TST_GRPSUBONE",
171 "profile" =>
"TST_PRF_SET",
181 "import" =>
"PROFIL;TST_PRF_RESET_DYNUSER;;RESET;view=tst_user;edit=tst_user",
182 "profile" =>
"TST_PRF_RESET_DYNUSER",
188 "import" =>
"PROFIL;TST_PRF_RESET_DYNUSER;;RESET;view=tst_user;delete=tst_user",
189 "profile" =>
"TST_PRF_RESET_DYNUSER",
196 "import" =>
"PROFIL;TST_PRF_SET_DYNUSER;;SET;view=tst_user;edit=tst_user",
197 "profile" =>
"TST_PRF_SET_DYNUSER",
198 "recomputed" =>
false
203 "import" =>
"PROFIL;TST_PRF_SET_DYNUSER;;SET;view=tst_user;delete=tst_user",
204 "profile" =>
"TST_PRF_SET_DYNUSER",
210 private function getViews(
$famid)
221 "profil" =>
"PU_data_dcp_setprofildata.ods",
222 "famName" =>
"TST_PROFIL",
227 "profil" =>
"PU_data_dcp_setprofildata.ods",
228 "famName" =>
"TST_PROFIL",
233 "profil" =>
"PU_data_dcp_setprofildata.ods",
234 "famName" =>
"TST_PROFIL",
247 "PU_data_dcp_profilJohn.ods",
258 "PU_data_dcp_profilJohn.ods",
269 "PU_data_dcp_profilJohn.ods",
280 "PU_data_dcp_profilJohn.ods",
288 "TST_DOCPRFUSERJANE",
291 "PU_data_dcp_profilUser.ods",
299 "TST_DOCPRFUSERJANE",
302 "PU_data_dcp_profilUser.ods",
310 "TST_DOCPRFUSERJOHN",
313 "PU_data_dcp_profilUser.ods",
321 "TST_DOCPRFUSERJOHN",
324 "PU_data_dcp_profilUser.ods",
332 "TST_DOCPRFUSERJOHN",
335 "PU_data_dcp_profilUserStatic.ods",
343 "TST_DOCPRFUSERJOHN",
346 "PU_data_dcp_profilUserStatic.ods",
419 "TST_PRFJANE_ACCOUNT",
430 "TST_PRFJANE_DOCUMENT",
450 "TST_PRFJANE_MIXEDNOTHING",
470 "TST_DOCPRFUSERJANE",
480 "TST_DOCPRFUSERJANE",
481 "TST_PRFDYNUSER_ATTR",
491 "TST_DOCPRFUSERJANE",
492 "TST_PRFDYNUSER_ACCOUNT",
503 "TST_DOCPRFUSERJANE",
504 "TST_PRFDYNUSER_ACCOUNT",
516 "TST_DOCPRFUSERJANE",
527 "TST_DOCPRFUSERJOHN",
538 "TST_DOCPRFUSERJOHN",
testProfilComputing($docName, $prfName, $login, $aclAttendees)
testSearchControlled($docName, $prfName, $login, $newPrfAcl, $aclAttendees)
static importDocument($file)
static resetDocumentCache()
testProfilDynamicChange($docName, $prfName, $login, $newPrfAcl, $aclAttendees)
getFamIdFromName($dbaccess, $name)
testProfilRecomputeProfiledDocuments($data)
static getCommonImportFile()
dataProfilRecomputeProfiledDocuments()
new_Doc($dbaccess, $id= '', $latest=false)
testSearchView($profFile, $famName, $login, $expectNumber)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)