13 require_once
'PU_testcase_dcp.php';
24 $d->setValue(
"ba_title",
"Initial");
25 $this->assertTrue(is_object(
$d) , sprintf(
"cannot create BASE document"));
27 $this->assertEmpty(
$err, sprintf(
"add error : $err"));
32 $this->assertEmpty(
$err, sprintf(
"revision rev.1 error : $err"));
37 $nd0->setValue(
"ba_title",
"a");
39 $this->assertContains(
"DOC0118",
$err, sprintf(
"modify rev.1 error : $err"));
42 $nd1->setValue(
"ba_title",
"a");
44 $this->assertEmpty(
$err, sprintf(
"modify rev.1 error : $err"));
47 $this->assertEmpty(
$err, sprintf(
"revision rev.2 error : $err"));
50 $nd1->setValue(
"ba_title",
"b");
52 $this->assertContains(
"DOC0118",
$err, sprintf(
"modify rev.1 error : $err"));
57 $err = $nd1->modify(
true, array(
60 $this->assertEmpty(
$err, sprintf(
"modify lock rev.1 error : $err"));
63 simpleQuery(
self::$dbaccess, sprintf(
"select id, title, revision, locked from only doc%d where initid=%d order by id", $nd1->fromid, $nd1->initid) ,
$r);
66 $this->assertTrue($nd1->isAlive() ,
"nd1 is not alive");
67 $nd1->setValue(
"ba_title",
"c");
70 $this->assertContains(
"DOC0119",
$err, sprintf(
"modify rev.1 error : $err"));
73 $nd2->setValue(
"ba_title",
"d");
75 $this->assertEmpty(
$err, sprintf(
"modify rev.2 error : $err"));
78 $err = $nd0->modify(
true, array(
81 $this->assertEmpty(
$err, sprintf(
"modify lock rev.0 error : $err"));
84 $err = $nd1->modify(
true, array(
87 $this->assertEmpty(
$err, sprintf(
"modify lock rev.1 error : $err"));
92 $this->assertTrue($nd1->isAlive() ,
"nd2 is not alive");
93 $nd2->setValue(
"ba_title",
"e");
95 $this->assertEmpty(
$err, sprintf(
"modify rev.1 error : $err"));
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err