Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use CGI qw ( -utf8 ); |
20 |
use CGI qw ( -utf8 ); |
21 |
|
21 |
|
22 |
use Test::More tests => 13; |
22 |
use Test::More tests => 14; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use t::lib::Mocks; |
24 |
use t::lib::Mocks; |
25 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
Lines 1043-1045
subtest 'GetAvailability itemcallnumber' => sub {
Link Here
|
1043 |
|
1043 |
|
1044 |
$schema->storage->txn_rollback; |
1044 |
$schema->storage->txn_rollback; |
1045 |
}; |
1045 |
}; |
1046 |
- |
1046 |
|
|
|
1047 |
subtest 'Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron' => sub { |
1048 |
|
1049 |
plan tests => 2; |
1050 |
|
1051 |
$schema->storage->txn_begin; |
1052 |
|
1053 |
my $plain_password = 'tomasito'; |
1054 |
|
1055 |
$builder->build({ |
1056 |
source => 'Borrower', |
1057 |
value => { |
1058 |
cardnumber => undef, |
1059 |
} |
1060 |
}); |
1061 |
|
1062 |
my $borrower0 = $builder->build({ |
1063 |
source => 'Borrower', |
1064 |
value => { |
1065 |
cardnumber => "cardnumber1", |
1066 |
userid => undef, |
1067 |
password => Koha::AuthUtils::hash_password( $plain_password ), |
1068 |
lastseen => "2001-01-01 12:34:56" |
1069 |
} |
1070 |
}); |
1071 |
|
1072 |
my $borrower = $builder->build({ |
1073 |
source => 'Borrower', |
1074 |
value => { |
1075 |
cardnumber => "cardnumber2", |
1076 |
userid => undef, |
1077 |
password => Koha::AuthUtils::hash_password( $plain_password ), |
1078 |
lastseen => "2001-01-01 12:34:56" |
1079 |
} |
1080 |
}); |
1081 |
|
1082 |
my $query = CGI->new; |
1083 |
$query->param( 'username', $borrower->{cardnumber}); |
1084 |
$query->param( 'password', $plain_password); |
1085 |
|
1086 |
my $reply = C4::ILSDI::Services::AuthenticatePatron( $query ); |
1087 |
is( $reply->{id}, $borrower->{borrowernumber}, "userid and password - Patron authenticated" ); |
1088 |
is( $reply->{code}, undef, "Error code undef"); |
1089 |
my $seen_patron = Koha::Patrons->find({ borrowernumber => $reply->{id} }); |
1090 |
|
1091 |
$schema->storage->txn_rollback; |
1092 |
}; |