ARSperl

 view release on metacpan or  search on metacpan

t/10entry.t  view on Meta::CPAN

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
}
 
# 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

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
}
 
# 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 )