ARSperl
view release on metacpan or search on metacpan
t/10entry.t view on Meta::CPAN
777879808182838485868788899091929394959697}
# test 6: add an attachment to the existing entry
if
(ars_APIVersion() >= 4) {
my
$filename
=
"t/aptest40.def"
;
$s
->set(
-entry
=>
$id
,
"-values"
=> {
'Attachment Field'
=>
{
file
=>
$filename
,
size
=> (
stat
(
$filename
))[7]
}
}
);
# retrieve it "in core"
my
$ic
=
$s
->getAttachment(
-entry
=>
$id
,
-field
=>
'Attachment Field'
);
open
(FD,
$filename
) ||
die
"not ok [open $!]\n"
;
t/10entry.t view on Meta::CPAN
111112113114115116117118119120121122123124125126127128129130131}
# test 7: create a new entry with an attachment
if
(ars_APIVersion() >= 4) {
my
$filename
=
"t/aptest40.def"
;
my
$nid
=
$s
->create(
"-values"
=> {
'Attachment Field'
=>
{
file
=>
$filename
,
size
=> (
stat
(
$filename
))[7]
},
'Submitter'
=>
&CCACHE::USERNAME
,
'Status'
=>
'Assigned'
,
'Short Description'
=>
'attach-create'
}
);
# retrieve it "in core"
my
$ic
=
$s
->getAttachment(
-entry
=>
$nid
,
-field
=>
'Attachment Field'
);
( run in 1.086 second using v1.01-cache-2.11-cpan-49f99fa48dc )