13 require_once
'PU_testcase_dcp.php';
22 private function initTestApplication()
25 $appTest->name = self::appName;
28 $appTest->set(self::appName,
$parent);
37 $appTest = $this->initTestApplication();
38 $this->assertTrue($appTest->isAffected() , sprintf(
"DCPTEST app not found"));
39 $appTest->param->DelStatic($appTest->id);
40 $appTest->InitAllParam($parameters, $update =
true);
42 foreach ($expectedValues as $k => $v) {
43 $this->assertEquals($v, $appTest->GetParam($k) , sprintf(
"wrong value for %s", $k));
49 public function testGlobParam(array $parameters, array $expectedGlob, array $expectedNoGlob)
52 $appTest = $this->initTestApplication();
53 $this->assertTrue($appTest->isAffected() , sprintf(
"DCPTEST app not found"));
54 $appTest->InitAllParam($parameters, $update =
true);
55 $this->
globParamTest($appTest, $expectedGlob, $expectedNoGlob);
60 public function testGlobMigrParam(array $parameters1, array $parameters2, array $expectedGlob, array $expectedNoGlob)
63 $appTest = $this->initTestApplication();
64 $this->assertTrue($appTest->isAffected() , sprintf(
"DCPTEST app not found"));
65 $appTest->InitAllParam($parameters1, $update =
true);
66 $appTest->InitAllParam($parameters2, $update =
true);
67 $this->
globParamTest($appTest, $expectedGlob, $expectedNoGlob);
74 foreach ($expectedGlob as $globId) {
80 $this->assertTrue($p->isAffected() , sprintf(
"not paramvalue glob %s", $globId));
82 $this->assertTrue($pdef->isAffected() , sprintf(
"not paramdef %s", $globId));
83 $this->assertEquals(
'Y', $pdef->isglob, sprintf(
"not a paramdef glob %s", $globId));
86 foreach ($expectedNoGlob as $globId) {
92 $this->assertTrue($p->isAffected() , sprintf(
"not paramvalue app %s", $globId));
94 $this->assertTrue($pdef->isAffected() , sprintf(
"not paramdef %s", $globId));
95 $this->assertEquals(
'N', $pdef->isglob, sprintf(
"not a paramdef app %s", $globId));
103 "VERSION" =>
"0.3.2-2",
104 "TST_NAMEP1" => array(
106 "descr" =>
N_(
"Name of the zoo") ,
110 "TST_GLOB1" => array(
112 "descr" =>
N_(
"Name of the glob") ,
118 "TST_NAMEP1" =>
"Zoo Land",
119 "VERSION" =>
"0.3.2-2",
120 "TST_GLOB1" =>
"Glob one"
125 "VERSION" =>
"0.3.2-2",
126 "TST_NAMEP1" => array(
128 "descr" =>
N_(
"Name of the zoo") ,
132 "TST_GLOB2" => array(
134 "descr" =>
N_(
"Name of the glob") ,
140 "TST_NAMEP1" =>
"Zoo Land",
141 "VERSION" =>
"0.3.2-2",
142 "TST_GLOB2" =>
"Glob two"
153 "VERSION" =>
"0.3.2-2",
154 "TST_NAMEP1" => array(
156 "descr" =>
N_(
"Name of the zoo") ,
160 "TST_GLOB1" => array(
162 "descr" =>
N_(
"Name of the glob") ,
183 "VERSION" =>
"0.3.2-2",
184 "TST_NAMEP1" => array(
186 "descr" =>
N_(
"Name of the zoo") ,
190 "TST_GLOB1" => array(
192 "descr" =>
N_(
"Name of the glob") ,
198 "TST_NAMEP1" => array(
200 "descr" =>
N_(
"Name of the zoo") ,
204 "TST_GLOB1" => array(
206 "descr" =>
N_(
"Name of the glob") ,
testGlobMigrParam(array $parameters1, array $parameters2, array $expectedGlob, array $expectedNoGlob)
testGetParam($parameters, array $expectedValues)
globParamTest(\Application &$appTest, array $expectedGlob, array $expectedNoGlob)
testGlobParam(array $parameters, array $expectedGlob, array $expectedNoGlob)