Bug 38505: CanBookBeIssued preparation: Add tests for falsy barcode

prove t/db_dependent/Circulation.t

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 45626c75c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Pedro Amorim 2024-11-21 15:37:09 +00:00 committed by Paul Derscheid
parent a52ab11e82
commit 5cc10bb9bf
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 5 additions and 1 deletions

View File

@ -2258,7 +2258,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub {
}
subtest 'CanBookBeIssued & AllowReturnToBranch' => sub {
plan tests => 24;
plan tests => 26;
my $homebranch = $builder->build( { source => 'Branch' } );
my $holdingbranch = $builder->build( { source => 'Branch' } );
@ -2305,6 +2305,10 @@ subtest 'CanBookBeIssued & AllowReturnToBranch' => sub {
set_userenv($homebranch);
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, 'KohaIsAwesome' );
ok( $error->{UNKNOWN_BARCODE}, '"KohaIsAwesome" is not a valid barcode as expected.' );
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, undef );
ok( $error->{UNKNOWN_BARCODE}, 'undef is not a valid barcode as expected.' );
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, '' );
ok( $error->{UNKNOWN_BARCODE}, '"" is not a valid barcode as expected.' );
## Can be issued from homebranch
set_userenv($homebranch);
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->barcode );