|
Lines 40-46
use C4::Biblio qw( AddBiblio ); # We shouldn't use it
Link Here
|
| 40 |
|
40 |
|
| 41 |
use Koha::CirculationRules; |
41 |
use Koha::CirculationRules; |
| 42 |
|
42 |
|
| 43 |
use Test::More tests => 20; |
43 |
use Test::More tests => 22; |
| 44 |
use MARC::Record; |
44 |
use MARC::Record; |
| 45 |
use MARC::Field; |
45 |
use MARC::Field; |
| 46 |
|
46 |
|
|
Lines 77-89
our $sample_data = {
Link Here
|
| 77 |
issuelength => '5', |
77 |
issuelength => '5', |
| 78 |
lengthunit => 'days', |
78 |
lengthunit => 'days', |
| 79 |
renewalperiod => '5', |
79 |
renewalperiod => '5', |
|
|
80 |
reservesallowed => '5', |
| 81 |
onshelfholds => '1', |
| 82 |
opacitemholds => 'Y', |
| 80 |
}, |
83 |
}, |
| 81 |
}; |
84 |
}; |
| 82 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
85 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
| 83 |
|
86 |
|
| 84 |
SKIP: { |
87 |
SKIP: { |
| 85 |
eval { require Selenium::Remote::Driver; }; |
88 |
eval { require Selenium::Remote::Driver; }; |
| 86 |
skip "Selenium::Remote::Driver is needed for selenium tests.", 20 if $@; |
89 |
skip "Selenium::Remote::Driver is needed for selenium tests.", 22 if $@; |
| 87 |
|
90 |
|
| 88 |
$cleanup_needed = 1; |
91 |
$cleanup_needed = 1; |
| 89 |
|
92 |
|
|
Lines 149-155
SKIP: {
Link Here
|
| 149 |
$dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); |
152 |
$dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); |
| 150 |
|
153 |
|
| 151 |
my $issuing_rules = $sample_data->{issuingrule}; |
154 |
my $issuing_rules = $sample_data->{issuingrule}; |
| 152 |
$dbh->do(q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, issuelength, lengthunit, renewalperiod) VALUES (?, ?, ?, ?, ?, ?)|, undef, $issuing_rules->{categorycode}, $issuing_rules->{itemtype}, $issuing_rules->{branchcode}, $issuing_rules->{issuelength}, $issuing_rules->{lengthunit}, $issuing_rules->{renewalperiod}); |
155 |
$dbh->do( |
|
|
156 |
q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, issuelength, lengthunit, renewalperiod, reservesallowed, onshelfholds, opacitemholds) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)|, |
| 157 |
undef, |
| 158 |
$issuing_rules->{categorycode}, |
| 159 |
$issuing_rules->{itemtype}, |
| 160 |
$issuing_rules->{branchcode}, |
| 161 |
$issuing_rules->{issuelength}, |
| 162 |
$issuing_rules->{lengthunit}, |
| 163 |
$issuing_rules->{renewalperiod}, |
| 164 |
$issuing_rules->{reservesallowed}, |
| 165 |
$issuing_rules->{onshelfholds}, |
| 166 |
$issuing_rules->{opacitemholds}, |
| 167 |
); |
| 153 |
Koha::CirculationRules->set_rules( |
168 |
Koha::CirculationRules->set_rules( |
| 154 |
{ |
169 |
{ |
| 155 |
categorycode => $issuing_rules->{categorycode}, |
170 |
categorycode => $issuing_rules->{categorycode}, |
|
Lines 224-229
SKIP: {
Link Here
|
| 224 |
|
239 |
|
| 225 |
time_diff("checkin"); |
240 |
time_diff("checkin"); |
| 226 |
|
241 |
|
|
|
242 |
#Place holds |
| 243 |
$driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[0]); |
| 244 |
$driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; # Biblio level |
| 245 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 246 |
is( $patron->holds->count, 1, ); |
| 247 |
|
| 248 |
$driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[1]); |
| 249 |
$driver->find_element('//form[@id="hold-request-form"]//input[@type="radio"]')->click; # Item level, there is only 1 item per bib so we are safe |
| 250 |
$driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; |
| 251 |
is( $patron->holds->count, 2, ); |
| 252 |
|
| 253 |
time_diff("holds"); |
| 254 |
|
| 227 |
close $fh; |
255 |
close $fh; |
| 228 |
$driver->quit(); |
256 |
$driver->quit(); |
| 229 |
}; |
257 |
}; |
| 230 |
- |
|
|