13 require_once
'PU_testcase_dcp.php';
14 require_once
'PU_testcase_dcp_application.php';
29 "appRoot" => join(DIRECTORY_SEPARATOR, array(
34 "appName" =>
"TST_PARAMETER_MANAGER"
42 private function initTestApplication($parameters)
45 $appTest->name = self::appName;
46 $appTest->childof =
'TST_PARAMETER_MANAGER';
47 $err = $appTest->Add();
49 $this->assertEmpty(
$err,
"Cannot create application : $err");
51 $appTest->set(self::appName,
$parent);
53 $this->assertTrue($appTest->isAffected(), sprintf(
"DCPTEST2 app not found"));
55 $appTest->InitAllParam($parameters, $update =
false);
58 $a->parent->param->SetKey($appTest->id,
$a->user->id);
70 $this->initTestApplication($parameters);
72 foreach ($expectedValues as $k => $v) {
83 $this->initTestApplication($parameters);
95 $this->initTestApplication($parameters);
106 $this->initTestApplication($parameters);
108 foreach ($expectedValues as $k => $v) {
119 $this->initTestApplication($parameters);
121 foreach ($expectedValues as $k => $v) {
132 $this->initTestApplication($parameters);
134 foreach ($newValues as $k => $v) {
137 foreach ($expectedValues as $k => $v) {
148 $this->initTestApplication($parameters);
150 foreach ($newValues as $k => $v) {
154 foreach ($expectedValues as $k => $v) {
165 $this->initTestApplication($parameters);
167 foreach ($newValues as $k => $v) {
170 foreach ($expectedValues as $k => $v) {
181 $definedParametersKey = array_keys($parameters);
183 $this->initTestApplication($parameters);
185 $filterFunction =
function (
$value) use ($applicationParameters) {
186 foreach ($applicationParameters as $currentApplicationParameters) {
187 if ($currentApplicationParameters[
"name"] ==
$value) {
193 $definedParametersKey = array_filter($definedParametersKey, $filterFunction);
194 $this->assertEquals(count($definedParametersKey), 0);
202 $this->initTestApplication($parameters);
205 $this->assertEquals(
"TST_GLOB1", $applicationParameter[
"name"]);
206 $this->assertEquals(
"Name of the glob", $applicationParameter[
"descr"]);
207 $this->assertEquals(
"Y", $applicationParameter[
"isglob"]);
208 $this->assertEquals(
"N", $applicationParameter[
"isuser"]);
217 "VERSION" =>
"4.0.8",
218 "PARENT_USER_GLOBAL_PARAMETER_VALUE" =>
"128",
219 "TST_NAMEP1" => array(
221 "descr" =>
"Name of test one",
225 "TST_GLOB2" => array(
226 "val" =>
"Test global 2",
227 "descr" =>
"Name of the glob",
233 "TST_NAMEP1" =>
"Test 3",
234 "TST_GLOB2" =>
"Test G3",
237 "TST_NAMEP1" =>
"Test 3",
238 "VERSION" =>
"4.0.8",
239 "TST_GLOB2" =>
"Test G3"
250 "VERSION" =>
"0.3.2-2",
251 "PARENT_USER_GLOBAL_PARAMETER_VALUE" =>
"128",
252 "TST_NAMEP1" => array(
254 "descr" =>
"Name of test one",
258 "TST_GLOB2" => array(
259 "val" =>
"Test global 2",
260 "descr" =>
"Name of the glob",
266 "PARENT_USER_PARAMETER" =>
"128,127",
267 "TST_NAMEP1" =>
"Test 3",
270 "TST_NAMEP1" =>
"Test 3",
271 "PARENT_USER_PARAMETER" =>
"128,127",
272 "TST_GLOB2" =>
"Test global 2"
283 "VERSION" =>
"4.0.8",
284 "PARENT_GLOBAL_PARAMETER" =>
"128",
285 "TST_NAMEP1" => array(
287 "descr" =>
"Name of test one",
291 "TST_GLOB2" => array(
292 "val" =>
"Test global 2",
293 "descr" =>
"Name of the glob",
299 "TST_NAMEP1" =>
"Test 3",
300 "TST_GLOB2" =>
"Test G3",
303 "TST_NAMEP1" =>
"Test 3",
304 "TST_GLOB2" =>
"Test G3"
315 "VERSION" =>
"0.3.2-2",
316 "PARENT_PARAMETER" =>
"128",
317 "TST_NAMEP1" => array(
319 "descr" =>
"Name of test one",
323 "TST_GLOB2" => array(
324 "val" =>
"Test global 2",
325 "descr" =>
"Name of the glob",
331 "VERSION" =>
"4.0.7",
332 "PARENT_PARAMETER" =>
"128,127",
333 "TST_NAMEP1" =>
"Test 3",
336 "TST_NAMEP1" =>
"Test 3",
337 "VERSION" =>
"4.0.7",
338 "PARENT_PARAMETER" =>
"128,127",
339 "TST_GLOB2" =>
"Test global 2"
350 "VERSION" =>
"0.3.2-2",
351 "PARENT_PARAMETER" =>
"128",
352 "TST_NAMEP1" => array(
354 "descr" =>
"Name of test one",
358 "TST_GLOB1" => array(
359 "val" =>
"Test global 1",
360 "descr" =>
"Name of the glob",
366 "TST_NAMEP1" =>
"Test 1",
367 "VERSION" =>
"0.3.2-2",
368 "PARENT_PARAMETER" =>
"128",
369 "TST_GLOB1" =>
"Test global 1"
380 "VERSION" =>
"0.3.2-2",
381 "PARENT_PARAMETER" =>
"128",
382 "TST_NAMEP1" => array(
384 "descr" =>
"Name of test one",
388 "TST_GLOB1" => array(
389 "val" =>
"Test global 2",
390 "descr" =>
"Name of the glob",
396 "TST_GLOB1" =>
"Test global 2"
407 "VERSION" =>
"0.3.2-2",
408 "PARENT_PARAMETER" =>
"128",
409 "TST_NAMEP1" => array(
411 "descr" =>
"Name of test one",
415 "TST_GLOB1" => array(
416 "val" =>
"Test global 2",
417 "descr" =>
"Name of the glob",
testSetUnknownParam($parameters)
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
testSetUserApplicationParameter($parameters, array $newValues, array $expectedValues)
static getParameterValue($application, $parameterName)
dataUserSetGlobalParameter()
static getScopedParameterValue($parameter)
static setParameterValue($application, $parameterName, $value)
testSetApplicationParameter($parameters, array $newValues, array $expectedValues)
dataSetUserApplicationParameter()
static getParameters($application)
testGetParam($parameters, array $expectedValues)
testGetScopedParam($parameters, array $expectedValues)
testGetParameter($parameters)
dataSetApplicationParameter()
testGetGlobalParam($parameters, array $expectedValues)
testGetUnknownParam($parameters)
testSetGlobalParameter($parameters, array $newValues, array $expectedValues)
static getCommonParameterValue($application, $parameterName)
if($file) if($subject==""&&$file) if($subject=="") $err
static getParameter($application, $parameterName)
testGetParameters($parameters)