13 require_once
'PU_testcase_dcp_commonfamily.php';
24 return "PU_data_dcp_somebasicdoc.ods";
32 $this->assertTrue(
$d->isAlive() , sprintf(
"document %d not alive",
$a));
44 $val =
"testing " . time();
45 $err =
$d->setValue(
"ba_desc", $val);
46 $this->assertEquals(
"",
$err, sprintf(
"cannot object update",
$a));
47 $this->assertEquals($val,
$d->getRawValue(
"ba_desc") , sprintf(
"document not updated",
$a));
49 $this->assertEquals(
"", $err, sprintf(
"cannot database update",
$a));
51 $sval = $this->
_DBGetValue(sprintf(
"select ba_desc from doc2 where id=%d",
$d->id));
52 $this->assertEquals($val, $sval, sprintf(
"document %d not locked",
$a));
54 $this->markTestIncomplete(sprintf(_(
'Document %d not alive.') ,
$a));
65 $val =
"testing " . time();
66 $err =
$d->setValue(
"ba_desc", $val);
67 $this->assertFalse(
$err ==
"", sprintf(_(
"cannot object update %s") ,
$a));
69 $this->markTestIncomplete(sprintf(_(
'Document %d not alive.') ,
$a));
77 public function testAddFile(
$a, $b)
84 if ($da->isAlive() &&
$db->isAlive()) {
86 $err = $da->insertDocument(
$db->initid);
88 $this->assertEquals(
"",
$err, sprintf(_(
"error ::addFile %s %s") ,
$a,
$err));
89 $sval = $this->
_DBGetValue(sprintf(
"select childid from fld where dirid=%d and childid=%d", $da->initid,
$db->initid));
91 $this->assertEquals(
$db->initid, $sval, sprintf(
"not inserted %s",
$a));
93 $this->markTestIncomplete(sprintf(_(
'Cannot insert : %s.') ,
$err));
96 $this->markTestIncomplete(sprintf(_(
'Document %d not alive.') ,
$a));
104 public function testMoveDocument(
$a, $b,
$c)
113 if ($da->isAlive() &&
$db->isAlive() && $dc->isAlive()) {
114 $sval = $this->
_DBGetValue(sprintf(
"select childid from fld where dirid=%d and childid=%d", $da->initid, $dc->initid));
117 if ($dc->initid != $sval) {
118 $this->markTestSkipped(sprintf(_(
"not present %s in %s") ,
$c,
$a));
120 $this->assertEquals($dc->initid, $sval, sprintf(
"not present %s in %s",
$c,
$a));
121 $err = $da->moveDocument($dc->initid,
$db->initid);
123 $this->assertEquals(
"",
$err, sprintf(_(
"error ::moveDocument %s %s") ,
$a,
$err));
124 $sval = $this->
_DBGetValue(sprintf(
"select childid from fld where dirid=%d and childid=%d", $da->initid, $dc->initid));
125 $this->assertFalse($sval, sprintf(
"not unlinked %s",
$a));
126 $sval = $this->
_DBGetValue(sprintf(
"select childid from fld where dirid=%d and childid=%d",
$db->initid, $dc->initid));
127 $this->assertEquals($dc->initid, $sval, sprintf(
"not inserted %s",
$a));
128 $sval = $this->
_DBGetValue(sprintf(
"select prelid from docread where initid=%d and locked != -1", $dc->initid));
129 $this->assertEquals(
$db->initid, $sval, sprintf(
"primary relation not updated %s",
$c));
131 $this->markTestIncomplete(sprintf(_(
'Cannot move : %s.') ,
$err));
134 $this->markTestIncomplete(sprintf(_(
'One of these documents %s not alive.') ,
$a .
"," . $b .
',' .
$c));
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
static getCommonImportFile()
if($file) if($subject==""&&$file) if($subject=="") $err