Lines 47-56
my $library1 = $builder->build({
Link Here
|
47 |
my $library2 = $builder->build({ |
47 |
my $library2 = $builder->build({ |
48 |
source => 'Branch', |
48 |
source => 'Branch', |
49 |
}); |
49 |
}); |
|
|
50 |
my $patron_category = $builder->build({ source => 'Category' }); |
50 |
my $CARDNUMBER = 'TESTCARD01'; |
51 |
my $CARDNUMBER = 'TESTCARD01'; |
51 |
my $FIRSTNAME = 'Marie'; |
52 |
my $FIRSTNAME = 'Marie'; |
52 |
my $SURNAME = 'Mcknight'; |
53 |
my $SURNAME = 'Mcknight'; |
53 |
my $CATEGORYCODE = 'S'; |
|
|
54 |
my $BRANCHCODE = $library1->{branchcode}; |
54 |
my $BRANCHCODE = $library1->{branchcode}; |
55 |
|
55 |
|
56 |
my $CHANGED_FIRSTNAME = "Marry Ann"; |
56 |
my $CHANGED_FIRSTNAME = "Marry Ann"; |
Lines 85-91
my %data = (
Link Here
|
85 |
cardnumber => $CARDNUMBER, |
85 |
cardnumber => $CARDNUMBER, |
86 |
firstname => $FIRSTNAME, |
86 |
firstname => $FIRSTNAME, |
87 |
surname => $SURNAME, |
87 |
surname => $SURNAME, |
88 |
categorycode => $CATEGORYCODE, |
88 |
categorycode => $patron_category->{categorycode}, |
89 |
branchcode => $BRANCHCODE, |
89 |
branchcode => $BRANCHCODE, |
90 |
dateofbirth => '', |
90 |
dateofbirth => '', |
91 |
dateexpiry => '9999-12-31', |
91 |
dateexpiry => '9999-12-31', |
Lines 100-106
my $member = GetMember( cardnumber => $CARDNUMBER )
Link Here
|
100 |
|
100 |
|
101 |
ok ( $member->{firstname} eq $FIRSTNAME && |
101 |
ok ( $member->{firstname} eq $FIRSTNAME && |
102 |
$member->{surname} eq $SURNAME && |
102 |
$member->{surname} eq $SURNAME && |
103 |
$member->{categorycode} eq $CATEGORYCODE && |
103 |
$member->{categorycode} eq $patron_category->{categorycode} && |
104 |
$member->{branchcode} eq $BRANCHCODE |
104 |
$member->{branchcode} eq $BRANCHCODE |
105 |
, "Got member") |
105 |
, "Got member") |
106 |
or diag("Mismatching member details: ".Dumper(\%data, $member)); |
106 |
or diag("Mismatching member details: ".Dumper(\%data, $member)); |
Lines 154-160
is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when
Link Here
|
154 |
cardnumber => "123456789", |
154 |
cardnumber => "123456789", |
155 |
firstname => "Tomasito", |
155 |
firstname => "Tomasito", |
156 |
surname => "None", |
156 |
surname => "None", |
157 |
categorycode => "S", |
157 |
categorycode => $patron_category->{categorycode}, |
158 |
branchcode => $library2->{branchcode}, |
158 |
branchcode => $library2->{branchcode}, |
159 |
dateofbirth => '', |
159 |
dateofbirth => '', |
160 |
debarred => '', |
160 |
debarred => '', |
Lines 367-376
isnt( Koha::Patrons->find( $patron2->{borrowernumber} )->lastseen, undef, 'Lasts
Link Here
|
367 |
## Remove all entries with userid='' (should be only 1 max) |
367 |
## Remove all entries with userid='' (should be only 1 max) |
368 |
$dbh->do(q|DELETE FROM borrowers WHERE userid = ''|); |
368 |
$dbh->do(q|DELETE FROM borrowers WHERE userid = ''|); |
369 |
## And create a patron with a userid='' |
369 |
## And create a patron with a userid='' |
370 |
$borrowernumber = AddMember( categorycode => 'S', branchcode => $library2->{branchcode} ); |
370 |
$borrowernumber = AddMember( categorycode => $patron_category->{categorycode}, branchcode => $library2->{branchcode} ); |
371 |
$dbh->do(q|UPDATE borrowers SET userid = '' WHERE borrowernumber = ?|, undef, $borrowernumber); |
371 |
$dbh->do(q|UPDATE borrowers SET userid = '' WHERE borrowernumber = ?|, undef, $borrowernumber); |
372 |
# Create another patron and verify the userid has been generated |
372 |
# Create another patron and verify the userid has been generated |
373 |
$borrowernumber = AddMember( categorycode => 'S', branchcode => $library2->{branchcode} ); |
373 |
$borrowernumber = AddMember( categorycode => $patron_category->{categorycode}, branchcode => $library2->{branchcode} ); |
374 |
ok( $borrowernumber > 0, 'AddMember should have inserted the patron even if no userid is given' ); |
374 |
ok( $borrowernumber > 0, 'AddMember should have inserted the patron even if no userid is given' ); |
375 |
$borrower = GetMember( borrowernumber => $borrowernumber ); |
375 |
$borrower = GetMember( borrowernumber => $borrowernumber ); |
376 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
376 |
ok( $borrower->{userid}, 'A userid should have been generated correctly' ); |
377 |
- |
|
|