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