Bugzilla – Attachment 34835 Details for
Bug 13502
A bug was introduced by 1861 - meaning borrowers sometimes cant be added
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13502: Add tests to highlight the problem
Bug-13502-Add-tests-to-highlight-the-problem.patch (text/plain), 2.70 KB, created by
Jonathan Druart
on 2014-12-31 11:13:59 UTC
(
hide
)
Description:
Bug 13502: Add tests to highlight the problem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-12-31 11:13:59 UTC
Size:
2.70 KB
patch
obsolete
>From 416b237e85edd2b6e6d7720dc4e9705454a4621f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 31 Dec 2014 12:09:49 +0100 >Subject: [PATCH] Bug 13502: Add tests to highlight the problem > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > t/db_dependent/Circulation/CheckIfIssuedToPatron.t | 2 ++ > t/db_dependent/Members.t | 14 +++++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t b/t/db_dependent/Circulation/CheckIfIssuedToPatron.t >index 10e10b6..612f22b 100644 >--- a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t >+++ b/t/db_dependent/Circulation/CheckIfIssuedToPatron.t >@@ -66,7 +66,9 @@ AddItem({ barcode => $barcode2, %item_branch_infos }, $biblionumber2); > my $borrowernumber1 = AddMember(categorycode => $categorycode, branchcode => $branchcode); > my $borrowernumber2 = AddMember(categorycode => $categorycode, branchcode => $branchcode); > my $borrower1 = GetMember(borrowernumber => $borrowernumber1); >+warn Data::Dumper::Dumper $borrower1; > my $borrower2 = GetMember(borrowernumber => $borrowernumber2); >+warn Data::Dumper::Dumper $borrower2; > > my $module = new Test::MockModule('C4::Context'); > $module->mock('userenv', sub { { branch => $branchcode } }); >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index f79e3f8..8c42aff 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 70; >+use Test::More tests => 72; > use Test::MockModule; > use Data::Dumper; > use C4::Context; >@@ -304,6 +304,18 @@ $borrowernumber = AddMember( %data ); > $borrower = GetMember( borrowernumber => $borrowernumber ); > is( $borrower->{userid}, $data{userid}, 'AddMember should insert the given userid' ); > >+# Regression tests for BZ13502 >+## 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 => 'MPL' ); >+$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 => 'MPL' ); >+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' ); >+ > # Regression tests for BZ12226 > is( Check_Userid( C4::Context->config('user'), '' ), 0, > 'Check_Userid should return 0 for the DB user (Bug 12226)'); >-- >2.1.0
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 13502
:
34832
|
34834
|
34835
|
34836
|
34847
|
34848
|
34849
|
34850