Lines 71-76
subtest 'after_circ_action() hook tests' => sub {
Link Here
|
71 |
my $biblio = $builder->build_sample_biblio(); |
71 |
my $biblio = $builder->build_sample_biblio(); |
72 |
my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); |
72 |
my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); |
73 |
my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); |
73 |
my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); |
|
|
74 |
my $item_no_issue = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); |
74 |
|
75 |
|
75 |
subtest 'AddIssue' => sub { |
76 |
subtest 'AddIssue' => sub { |
76 |
plan tests => 2; |
77 |
plan tests => 2; |
Lines 101-107
subtest 'after_circ_action() hook tests' => sub {
Link Here
|
101 |
}; |
102 |
}; |
102 |
|
103 |
|
103 |
subtest 'AddReturn' => sub { |
104 |
subtest 'AddReturn' => sub { |
104 |
plan tests => 2; |
105 |
plan tests => 3; |
105 |
|
106 |
|
106 |
t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 1); |
107 |
t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 1); |
107 |
$item_1->set({ withdrawn => 1 })->store; |
108 |
$item_1->set({ withdrawn => 1 })->store; |
Lines 113-123
subtest 'after_circ_action() hook tests' => sub {
Link Here
|
113 |
t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 0); |
114 |
t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 0); |
114 |
$item_1->set({ withdrawn => 0 })->store; |
115 |
$item_1->set({ withdrawn => 0 })->store; |
115 |
|
116 |
|
116 |
warning_like { |
117 |
warning_like { AddReturn( $item_1->barcode, $patron->branchcode ); } |
117 |
AddReturn( $item_1->barcode, $patron->branchcode ); |
|
|
118 |
} |
119 |
qr/after_circ_action called with action: checkin, ref: Koha::Old::Checkout/, |
118 |
qr/after_circ_action called with action: checkin, ref: Koha::Old::Checkout/, |
120 |
'AddReturn calls the after_circ_action hook'; |
119 |
'AddReturn calls the after_circ_action hook'; |
|
|
120 |
|
121 |
warning_like { AddReturn( $item_no_issue->barcode, $patron->branchcode ); } |
122 |
qr/after_circ_action called with action: checkin_no_issue, ref: Koha::Item/, |
123 |
'AddReturn calls the after_circ_action hook'; |
121 |
}; |
124 |
}; |
122 |
|
125 |
|
123 |
$schema->storage->txn_rollback; |
126 |
$schema->storage->txn_rollback; |