|
Lines 2-8
Link Here
|
| 2 |
|
2 |
|
| 3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
| 4 |
use File::Temp qw/ tempdir /; |
4 |
use File::Temp qw/ tempdir /; |
| 5 |
use Test::More tests => 12; |
5 |
use Test::More tests => 13; |
| 6 |
use Test::Warn; |
6 |
use Test::Warn; |
| 7 |
|
7 |
|
| 8 |
use Test::MockModule; |
8 |
use Test::MockModule; |
|
Lines 316-321
subtest 'Testing delete_temporary' => sub {
Link Here
|
| 316 |
'Still 3 permanent uploads' ); |
316 |
'Still 3 permanent uploads' ); |
| 317 |
}; |
317 |
}; |
| 318 |
|
318 |
|
|
|
319 |
subtest 'Testing download headers' => sub { |
| 320 |
plan tests => 2; |
| 321 |
my $test_pdf = Koha::UploadedFile->new({ filename => 'pdf.pdf', uploadcategorycode => 'B', filesize => 1000 }); |
| 322 |
my $test_not = Koha::UploadedFile->new({ filename => 'pdf.not', uploadcategorycode => 'B', filesize => 1000 }); |
| 323 |
my @pdf_expect = ( '-type'=>'application/pdf','Content-Disposition'=>'inline; filename=pdf.pdf' ); |
| 324 |
my @not_expect = ( '-type'=>'application/octet-stream','-attachment'=>'pdf.not' ); |
| 325 |
my @pdf_head = $test_pdf->httpheaders; |
| 326 |
my @not_head = $test_not->httpheaders; |
| 327 |
is_deeply(\@pdf_head, \@pdf_expect,"Get inline pdf headers for pdf"); |
| 328 |
is_deeply(\@not_head, \@not_expect,"Get download headers for non pdf"); |
| 329 |
}; |
| 319 |
# The end |
330 |
# The end |
| 320 |
$schema->storage->txn_rollback; |
331 |
$schema->storage->txn_rollback; |
| 321 |
|
332 |
|
| 322 |
- |
|
|