Bugzilla – Attachment 62092 Details for
Bug 18420
Some tests fail without patron category 'S'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18420: Fix Members.t when no patron category 'S' exists
Bug-18420-Fix-Memberst-when-no-patron-category-S-e.patch (text/plain), 3.16 KB, created by
Jonathan Druart
on 2017-04-12 14:12:22 UTC
(
hide
)
Description:
Bug 18420: Fix Members.t when no patron category 'S' exists
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-12 14:12:22 UTC
Size:
3.16 KB
patch
obsolete
>From cf5ee980056814108ba45ab93e495ba268ddbfc6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Apr 2017 11:10:57 -0300 >Subject: [PATCH] Bug 18420: Fix Members.t when no patron category 'S' exists > >No need to create Staff users here. > >Test plan: > prove t/db_dependent/Members.t >should return green, even if no categories.categorycode 'S' exists >--- > t/db_dependent/Members.t | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 8520777..080c969 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -47,10 +47,10 @@ my $library1 = $builder->build({ > my $library2 = $builder->build({ > source => 'Branch', > }); >+my $patron_category = $builder->build({ source => 'Category' }); > my $CARDNUMBER = 'TESTCARD01'; > my $FIRSTNAME = 'Marie'; > my $SURNAME = 'Mcknight'; >-my $CATEGORYCODE = 'S'; > my $BRANCHCODE = $library1->{branchcode}; > > my $CHANGED_FIRSTNAME = "Marry Ann"; >@@ -85,7 +85,7 @@ my %data = ( > cardnumber => $CARDNUMBER, > firstname => $FIRSTNAME, > surname => $SURNAME, >- categorycode => $CATEGORYCODE, >+ categorycode => $patron_category->{categorycode}, > branchcode => $BRANCHCODE, > dateofbirth => '', > dateexpiry => '9999-12-31', >@@ -100,7 +100,7 @@ my $member = GetMember( cardnumber => $CARDNUMBER ) > > ok ( $member->{firstname} eq $FIRSTNAME && > $member->{surname} eq $SURNAME && >- $member->{categorycode} eq $CATEGORYCODE && >+ $member->{categorycode} eq $patron_category->{categorycode} && > $member->{branchcode} eq $BRANCHCODE > , "Got member") > or diag("Mismatching member details: ".Dumper(\%data, $member)); >@@ -154,7 +154,7 @@ is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when > cardnumber => "123456789", > firstname => "Tomasito", > surname => "None", >- categorycode => "S", >+ categorycode => $patron_category->{categorycode}, > branchcode => $library2->{branchcode}, > dateofbirth => '', > debarred => '', >@@ -367,10 +367,10 @@ isnt( Koha::Patrons->find( $patron2->{borrowernumber} )->lastseen, undef, 'Lasts > ## Remove all entries with userid='' (should be only 1 max) > $dbh->do(q|DELETE FROM borrowers WHERE userid = ''|); > ## And create a patron with a userid='' >-$borrowernumber = AddMember( categorycode => 'S', branchcode => $library2->{branchcode} ); >+$borrowernumber = AddMember( categorycode => $patron_category->{categorycode}, branchcode => $library2->{branchcode} ); > $dbh->do(q|UPDATE borrowers SET userid = '' WHERE borrowernumber = ?|, undef, $borrowernumber); > # Create another patron and verify the userid has been generated >-$borrowernumber = AddMember( categorycode => 'S', branchcode => $library2->{branchcode} ); >+$borrowernumber = AddMember( categorycode => $patron_category->{categorycode}, branchcode => $library2->{branchcode} ); > ok( $borrowernumber > 0, 'AddMember should have inserted the patron even if no userid is given' ); > $borrower = GetMember( borrowernumber => $borrowernumber ); > ok( $borrower->{userid}, 'A userid should have been generated correctly' ); >-- >2.9.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18420
:
62090
|
62091
|
62092
|
62093
|
62095
|
62115
|
62118
|
62164
|
62174
|
62175
|
62176
|
62177
|
62178
|
62179
|
62180
|
62274
|
62275
|
62276
|
62277
|
62278
|
62279
|
62280
|
112053