Lines 5-11
Link Here
|
5 |
# Larger modifications by Jonathan Druart and Marcel de Rooy |
5 |
# Larger modifications by Jonathan Druart and Marcel de Rooy |
6 |
|
6 |
|
7 |
use Modern::Perl; |
7 |
use Modern::Perl; |
8 |
use Test::More tests => 81; |
8 |
use Test::More tests => 83; |
9 |
use MARC::Record; |
9 |
use MARC::Record; |
10 |
|
10 |
|
11 |
use C4::Biblio qw( AddBiblio DelBiblio ); |
11 |
use C4::Biblio qw( AddBiblio DelBiblio ); |
Lines 173-178
for(my $i=0; $i<10;$i++){
Link Here
|
173 |
} |
173 |
} |
174 |
} |
174 |
} |
175 |
|
175 |
|
|
|
176 |
#----------------------- TEST AddShare ----------------------------------------# |
177 |
|
178 |
#first count the number of shares in the table; keep in mind that AddShare may |
179 |
#delete some expired records while housekeeping |
180 |
my $sql_sharecount="select count(*) from virtualshelfshares where DATEDIFF(sharedate, NOW())>0"; |
181 |
my $cnt1=$dbh->selectrow_array($sql_sharecount); |
182 |
|
183 |
#try to add a share without shelfnumber: should fail |
184 |
AddShare(0, 'abcdefghij'); |
185 |
my $cnt2=$dbh->selectrow_array($sql_sharecount); |
186 |
ok($cnt1 == $cnt2, "Did not add an invalid share record"); |
187 |
|
188 |
#add another share: should be okay |
189 |
#AddShare assumes that you tested if category==private (so we could actually |
190 |
#be doing something illegal here :) |
191 |
my $n=$shelves[0]->{number}; |
192 |
if($n<0) { |
193 |
ok(1, 'Skip AddShare for shelf -1'); |
194 |
} |
195 |
else { |
196 |
AddShare($n, 'abcdefghij'); |
197 |
my $cnt3=$dbh->selectrow_array($sql_sharecount); |
198 |
ok(1+$cnt2 == $cnt3, "Added one new share record with invitekey"); |
199 |
} |
200 |
|
176 |
#-----------------------TEST DelShelf & DelFromShelf functions------------------------# |
201 |
#-----------------------TEST DelShelf & DelFromShelf functions------------------------# |
177 |
# usage : ($status) = &DelShelf($shelfnumber); |
202 |
# usage : ($status) = &DelShelf($shelfnumber); |
178 |
|
203 |
|
179 |
- |
|
|