13 require_once
'PU_testcase_dcp_commonfamily.php';
24 return "PU_data_dcp_familycomputed.ods";
36 $this->assertTrue(is_object(
$d) , sprintf(
"cannot create %s document", $this->famName));
39 foreach ($inputs as $k => $v) {
43 $tmpLogFile = tempnam(
getTmpDir() , __FUNCTION__);
44 $d->log = new \Log($tmpLogFile,
$d->log->application,
$d->log->function);
46 $info = new \storeInfo();
49 $log = file_get_contents($tmpLogFile);
52 $this->assertEmpty(
$err, sprintf(
"cannot modify %s document", $this->famName));
53 foreach ($expectedvalues as $k => $v) {
54 if (is_array($v))
$value =
$d->getMultipleRawValues($k);
56 $this->assertEquals($v,
$value, sprintf(
"error computed %s", $k));
58 $this->assertEmpty(
$info->refresh, sprintf(
"refresh returned with unexpected error: %s",
$info->refresh));
59 foreach ($logMatch as $re) {
60 $this->assertTrue(preg_match($re,
$log) == 1, sprintf(
"log did not contained expected message '%s'", $re));
89 'tst_number10' => array(
95 'tst_number1' => $x1 = $x,
96 'tst_number2' => $x2 = $x + 1,
97 'tst_number3' => $x3 = $x2 + 1,
98 'tst_number4' => $x4 = 30 + 5 + 15,
99 'tst_number6' => $x6 = 1 + 2 + 3,
100 'tst_number7' => $x7 = $x1 + $x2 + $x3,
101 'tst_number9' => $x9 = $x3 + 10,
102 'tst_text1' =>
'NULL',
103 'tst_text2' =>
'zero',
104 'tst_text3' =>
"[the][beautiful][ rainbow ,][.]",
105 'tst_text4' =>
'one',
106 "tst_number11" => array(
110 "tst_number12" => array(
120 '/\[W\].*{ATTR1800} value of attribute "tst_vis_i_1"/',
121 '/\[W\].*{ATTR1800} value of attribute "tst_vis_i_3"/'
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
testComputedValue(array $inputs, array $expectedvalues, array $logMatch)
static getCommonImportFile()
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
if($file) if($subject==""&&$file) if($subject=="") $err