From 59de001c105d345688fd9d4941ccac1de4e11c7c Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 21 Nov 2024 15:37:09 +0000 Subject: [PATCH] Bug 38505: CanBookBeIssued preparation: Add tests for falsy barcode prove t/db_dependent/Circulation.t Signed-off-by: Ray Delahunty Signed-off-by: Martin Renvoize --- t/db_dependent/Circulation.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index f26069e939e..ce382776102 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -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 ); -- 2.47.1