Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 100; |
20 |
use Test::More tests => 101; |
21 |
|
21 |
|
22 |
use DateTime; |
22 |
use DateTime; |
23 |
|
23 |
|
Lines 1360-1365
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
1360 |
is( $error->{USERBLOCKEDNOENDDATE}, '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' ); |
1360 |
is( $error->{USERBLOCKEDNOENDDATE}, '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' ); |
1361 |
}; |
1361 |
}; |
1362 |
|
1362 |
|
|
|
1363 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
1364 |
plan tests => 1; |
1365 |
|
1366 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
1367 |
my $patron_category = $builder->build_object( |
1368 |
{ |
1369 |
class => 'Koha::Patron::Categories', |
1370 |
value => { category_type => 'X' } |
1371 |
} |
1372 |
); |
1373 |
my $patron = $builder->build_object( |
1374 |
{ |
1375 |
class => 'Koha::Patrons', |
1376 |
value => { |
1377 |
categorycode => $patron_category->categorycode, |
1378 |
gonenoaddress => undef, |
1379 |
lost => undef, |
1380 |
debarred => undef, |
1381 |
borrowernotes => "" |
1382 |
} |
1383 |
} |
1384 |
); |
1385 |
my $biblioitem_1 = $builder->build( { source => 'Biblioitem' } ); |
1386 |
my $item_1 = $builder->build( |
1387 |
{ |
1388 |
source => 'Item', |
1389 |
value => { |
1390 |
homebranch => $library->branchcode, |
1391 |
holdingbranch => $library->branchcode, |
1392 |
notforloan => 0, |
1393 |
itemlost => 0, |
1394 |
withdrawn => 0, |
1395 |
restricted => 0, |
1396 |
biblionumber => $biblioitem_1->{biblionumber} |
1397 |
} |
1398 |
} |
1399 |
); |
1400 |
|
1401 |
my ( $error, $question, $alerts ) = CanBookBeIssued( $patron->unblessed, $item_1->{barcode} ); |
1402 |
is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' ); |
1403 |
|
1404 |
# TODO There are other tests to provide here |
1405 |
}; |
1406 |
|
1363 |
subtest 'MultipleReserves' => sub { |
1407 |
subtest 'MultipleReserves' => sub { |
1364 |
plan tests => 3; |
1408 |
plan tests => 3; |
1365 |
|
1409 |
|
1366 |
- |
|
|