13 require_once
'PU_testcase_dcp_commonfamily.php';
34 $err = $vds->Store(
$data[
'infile'],
$data[
'public_access'], $id_file);
35 if (!
$data[
'expect:success']) {
36 $this->assertNotEmpty(
$err, sprintf(
"Store(%s) did not returned with an expected error.",
$data[
'infile']));
39 $this->assertEmpty(
$err, sprintf(
"Unexpected error in Store(%s): %s",
$data[
'infile'],
$err));
40 $this->assertNotNull($id_file, sprintf(
"Store(%s) returned a null id_file.",
$data[
'infile']));
41 $this->assertTrue(is_numeric($id_file) , sprintf(
"Store(%s) did not returned a numeric id_file.",
$data[
'infile']));
42 $this->assertTrue(($id_file > 0) , sprintf(
"Store(%s) did not returned an id_file > 0.",
$data[
'infile']));
49 "infile" =>
"DCPTEST/Layout/tst_VaultDiskStorage.odt",
50 "public_access" =>
false,
51 "expect:success" =>
true
54 "infile" =>
"DCPTEST/Layout/tst_VaultDiskStorage_non_existing_file.odt",
55 "public_access" =>
false,
56 "expect:success" =>
false
69 $err = $vds->Store(
$data[
'infile'],
false, $id_file);
71 $this->markTestIncomplete(sprintf(
"Store(%s) returned with error: %s",
$data[
'infile'],
$err));
76 $err = $vds->show($id_file, $vfi);
77 $this->assertEmpty(
$err, sprintf(
"show(%s) returned with error: %s", $id_file,
$err));
78 $this->assertTrue(is_object($vfi) , sprintf(
"show(%s) did not returned an object.", $id_file));
79 $this->assertTrue(is_a($vfi,
'\VaultFileInfo') , sprintf(
"show(%s) dit not returned a VaultFileInfo object: class is %s", $id_file, get_class($vfi)));
86 "infile" =>
"DCPTEST/Layout/tst_VaultDiskStorage.odt"
99 $err = $vds->Store(
$data[
'infile'],
false, $id_file);
101 $this->markTestIncomplete(sprintf(
"Store(%s) returned with error: %s",
$data[
'infile'],
$err));
105 $this->assertTrue($vds->isAffected() , sprintf(
"Could not get back id_file '%s' from previously stored file '%s'.", $id_file,
$data[
'infile']));
107 $path = $vds->getPath();
108 $this->assertNotEmpty($path, sprintf(
"getPath() on id_file '%s' returned an empty path.", $id_file));
109 $this->assertTrue(is_file($path) , sprintf(
"getPath() returned path '%s' for id_file '%s' is not a file.", $path, $id_file));
116 "infile" =>
"DCPTEST/Layout/tst_VaultDiskStorage.odt"
129 $err = $vds->Store(
$data[
'infile'],
false, $id_file);
131 $this->markTestIncomplete(sprintf(
"Store(%s) returned with error: %s",
$err));
135 if (!$vds->isAffected()) {
136 $this->markTestIncomplete(sprintf(
"Could not get back id_file '%s' from previously stored file '%s'.", $id_file,
$data[
'infile']));
139 $path = $vds->getPath();
140 if (!is_file(
$path)) {
141 $this->markTestIncomplete(sprintf(
"Invalid path '%s' for stored file '%s' with id_file '%s'.",
$path,
$data[
'infile'], $id_file));
144 $err = $vds->Destroy($id_file);
145 $this->assertEmpty(
$err, sprintf(
"Destroy() returned with error: %s",
$err));
146 $this->assertFalse(is_file(
$path) , sprintf(
"File '%s' from id_file %s is still present after Destroy().",
$path, $id_file));
149 $this->assertFalse($vds->isAffected() , sprintf(
"id_file '%s' is still present in database after Destroy().", $id_file));
156 "infile" =>
"DCPTEST/Layout/tst_VaultDiskStorage.odt"
static getCommonImportFile()
if($file) if($subject==""&&$file) if($subject=="") $err