13 require_once
'PU_testcase_dcp_commonfamily.php';
25 return "PU_data_dcp_datefamily.ods";
33 $this->assertTrue($origin->isAlive() ,
"cannot find $docid document");
36 $this->assertTrue(is_object($target) , sprintf(
"cannot create %s ", self::testFamily));
38 $err = $target->transfertValuesFrom($origin);
39 $this->assertEmpty(
$err, sprintf(
"cannot transfert values from %s", self::testFamily));
40 $err = $target->add();
41 $this->assertEmpty(
$err, sprintf(
"cannot add %s ", self::testFamily));
45 $this->verifyValues($target, $expectedValues);
55 $this->assertTrue($origin->isAlive() ,
"cannot find $docid document");
56 $target = $origin->duplicate();
57 $target->transfertValuesFrom($origin);
58 $this->verifyValues($target, $expectedValues);
59 $this->verifyHtmlValues($origin, $target, array_keys($expectedValues));
62 private function verifyValues(\
Doc $test, array $expectedValues)
64 foreach ($expectedValues as $k => $expectValue) {
67 $this->assertEquals($expectValue, $targetValue, sprintf(
"wrong value %s", $k));
71 private function verifyHtmlValues(\
Doc $origin, \
Doc $target, array $attributeIds)
73 foreach ($attributeIds as $attrid) {
76 $this->assertEquals($tv,
$to, sprintf(
"wrong html value %s", $attrid));
86 "tst_date" =>
'2012-02-29',
87 "tst_ts" =>
'2012-02-29 12:23:00',
getHtmlAttrValue($attrid, $target="_self", $htmllink=2, $index=-1, $entities=true, $abstract=false)
testDateCopy($docid, array $expectedValues)
static getCommonImportFile()
getMultipleRawValues($idAttr, $def="", $index=-1)
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
new_Doc($dbaccess, $id= '', $latest=false)
testDateTransfert($docid, array $expectedValues)
if($file) if($subject==""&&$file) if($subject=="") $err
getRawValue($idAttr, $def="")