Lines 1-6
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
# Copyright 2017 Koha Development team |
3 |
# Copyright 2020 Koha Development team |
4 |
# |
4 |
# |
5 |
# This file is part of Koha |
5 |
# This file is part of Koha |
6 |
# |
6 |
# |
Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 1; |
22 |
use Test::More tests => 2; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use C4::Reserves; |
25 |
use C4::Reserves; |
Lines 34-39
$schema->storage->txn_begin;
Link Here
|
34 |
|
34 |
|
35 |
my $builder = t::lib::TestBuilder->new; |
35 |
my $builder = t::lib::TestBuilder->new; |
36 |
|
36 |
|
|
|
37 |
subtest 'DB constraints' => sub { |
38 |
plan tests => 1; |
39 |
|
40 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
41 |
my $item = $builder->build_sample_item; |
42 |
my $hold_info = { |
43 |
branchcode => $patron->branchcode, |
44 |
borrowernumber => $patron->borrowernumber, |
45 |
biblionumber => $item->biblionumber, |
46 |
priority => 1, |
47 |
title => "title for fee", |
48 |
itemnumber => $item->itemnumber, |
49 |
}; |
50 |
|
51 |
my $reserve_id = C4::Reserves::AddReserve($hold_info); |
52 |
my $hold = Koha::Holds->find( $reserve_id ); |
53 |
|
54 |
warning_like { |
55 |
eval { $hold->priority(undef)->store } |
56 |
} |
57 |
qr{.*DBD::mysql::st execute failed: Column 'priority' cannot be null.*}, |
58 |
'DBD should have raised an error about priority that cannot be null'; |
59 |
}; |
60 |
|
37 |
subtest 'cancel' => sub { |
61 |
subtest 'cancel' => sub { |
38 |
plan tests => 12; |
62 |
plan tests => 12; |
39 |
my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } ); |
63 |
my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } ); |
40 |
- |
|
|