Lines 62-68
our $sample_data = {
Link Here
|
62 |
userid => 'test_username', |
62 |
userid => 'test_username', |
63 |
password => 'password', |
63 |
password => 'password', |
64 |
password2 => 'password' |
64 |
password2 => 'password' |
65 |
|
|
|
66 |
}, |
65 |
}, |
67 |
itemtype => { |
66 |
itemtype => { |
68 |
itemtype => 'IT4TEST', |
67 |
itemtype => 'IT4TEST', |
Lines 70-75
our $sample_data = {
Link Here
|
70 |
rentalcharge => 0, |
69 |
rentalcharge => 0, |
71 |
notforloan => 0, |
70 |
notforloan => 0, |
72 |
}, |
71 |
}, |
|
|
72 |
issuingrule => { |
73 |
categorycode => 'test_cat', |
74 |
itemtype => 'IT4test', |
75 |
branchcode => '*', |
76 |
maxissueqty => '5', |
77 |
issuelength => '5', |
78 |
lengthunit => 'days', |
79 |
renewalperiod => '5', |
80 |
}, |
73 |
}; |
81 |
}; |
74 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
82 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
75 |
|
83 |
|
Lines 136-141
SKIP: {
Link Here
|
136 |
my $itemtype = $sample_data->{itemtype}; |
144 |
my $itemtype = $sample_data->{itemtype}; |
137 |
$dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); |
145 |
$dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); |
138 |
|
146 |
|
|
|
147 |
my $issuing_rules = $sample_data->{issuingrule}; |
148 |
$dbh->do(q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, maxissueqty, issuelength, lengthunit, renewalperiod) VALUES (?, ?, ?, ?, ?, ?, ?)|, undef, $issuing_rules->{categorycode}, $issuing_rules->{itemtype}, $issuing_rules->{branchcode}, $issuing_rules->{maxissueqty}, $issuing_rules->{issuelength}, $issuing_rules->{lengthunit}, $issuing_rules->{renewalperiod}); |
149 |
|
139 |
for my $biblionumber ( @biblionumbers ) { |
150 |
for my $biblionumber ( @biblionumbers ) { |
140 |
$driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); |
151 |
$driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); |
141 |
like( $driver->get_title(), qr(test biblio \d+ by test author), ); |
152 |
like( $driver->get_title(), qr(test biblio \d+ by test author), ); |
Lines 223-228
sub cleanup {
Link Here
|
223 |
$dbh->do(qq|DELETE items, biblio FROM biblio INNER JOIN items ON biblio.biblionumber = items.biblionumber WHERE biblio.title = "test biblio$i"|); |
234 |
$dbh->do(qq|DELETE items, biblio FROM biblio INNER JOIN items ON biblio.biblionumber = items.biblionumber WHERE biblio.title = "test biblio$i"|); |
224 |
}; |
235 |
}; |
225 |
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype}); |
236 |
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype}); |
|
|
237 |
$dbh->do(q|DELETE FROM issuingrules WHERE categorycode=? AND itemtype=? AND branchcode=?|, undef, $sample_data->{issuingrule}{categorycode}, $sample_data->{issuingrule}{itemtype}, $sample_data->{issuingrule}{branchcode}); |
226 |
} |
238 |
} |
227 |
|
239 |
|
228 |
sub time_diff { |
240 |
sub time_diff { |
229 |
- |
|
|