Bugzilla – Attachment 61448 Details for
Bug 12026
Shibboleth auto-provisioning - Create
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12026: [QA Follow-up] POD typo and tiny change in AddMember_Opac
Bug-12026-QA-Follow-up-POD-typo-and-tiny-change-in.patch (text/plain), 3.53 KB, created by
Martin Renvoize (ashimema)
on 2017-03-22 13:58:55 UTC
(
hide
)
Description:
Bug 12026: [QA Follow-up] POD typo and tiny change in AddMember_Opac
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2017-03-22 13:58:55 UTC
Size:
3.53 KB
patch
obsolete
>From 2ee5e469f9c7fd3217344749ebfeebd22bd14f15 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 21 Mar 2017 10:27:03 +0100 >Subject: [PATCH] Bug 12026: [QA Follow-up] POD typo and tiny change in > AddMember_Opac > >[1] Correct xml error in POD >Copy-pasting this example from Auth_with_shibboleth.pm into koha-conf.xml >did not work. We need a closing tag ;) >[2] If AddMember_Opac calls AddMember_Auto, there is no need to call >fixup_cardnumber. Adding trivial test for AddMember_Auto in Members.t. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth_with_shibboleth.pm | 2 +- > C4/Members.pm | 2 -- > t/db_dependent/Members.t | 20 ++++++++++++++++---- > 3 files changed, 17 insertions(+), 7 deletions(-) > >diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm >index 6a9a1cf..1c996a2 100644 >--- a/C4/Auth_with_shibboleth.pm >+++ b/C4/Auth_with_shibboleth.pm >@@ -256,7 +256,7 @@ This is as simple as enabling B<useshibboleth> in koha-conf.xml: > Map shibboleth attributes to koha fields, and configure authentication match point in koha-conf.xml. > > <shibboleth> >- <matchpoint>userid<matchpoint> <!-- koha borrower field to match upon --> >+ <matchpoint>userid</matchpoint> <!-- koha borrower field to match upon --> > <mapping> > <userid is="eduPersonID"></userid> <!-- koha borrower field to shibboleth attribute mapping --> > </mapping> >diff --git a/C4/Members.pm b/C4/Members.pm >index abdffb4..ee10cc7 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1291,8 +1291,6 @@ sub AddMember_Opac { > $borrower{'password'} = $password; > } > >- $borrower{'cardnumber'} = fixup_cardnumber( $borrower{'cardnumber'} ); >- > %borrower = AddMember_Auto(%borrower); > > return ( $borrower{'borrowernumber'}, $borrower{'password'} ); >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 3d24e44..8520777 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,9 +17,9 @@ > > use Modern::Perl; > >-use Test::More tests => 64; >+use Test::More tests => 65; > use Test::MockModule; >-use Data::Dumper; >+use Data::Dumper qw/Dumper/; > use C4::Context; > use Koha::Database; > use Koha::Holds; >@@ -37,7 +37,6 @@ my $schema = Koha::Database->schema; > $schema->storage->txn_begin; > my $builder = t::lib::TestBuilder->new; > my $dbh = C4::Context->dbh; >-$dbh->{RaiseError} = 1; > > # Remove invalid guarantorid's as long as we have no FK > $dbh->do("UPDATE borrowers b1 LEFT JOIN borrowers b2 ON b2.borrowernumber=b1.guarantorid SET b1.guarantorid=NULL where b1.guarantorid IS NOT NULL AND b2.borrowernumber IS NULL"); >@@ -491,4 +490,17 @@ eval { > is($@, '', 'Bug 16009: GetMember(cardnumber => undef) works'); > is($patron, undef, 'Bug 16009: GetMember(cardnumber => undef) returns undef'); > >-1; >+subtest 'Trivial test for AddMember_Auto' => sub { >+ plan tests => 3; >+ my $members_mock = Test::MockModule->new( 'C4::Members' ); >+ $members_mock->mock( 'fixup_cardnumber', sub { 12345; } ); >+ my $library = $builder->build({ source => 'Branch' }); >+ my $category = $builder->build({ source => 'Category' }); >+ my %borr = AddMember_Auto( surname=> 'Dick3', firstname => 'Philip', branchcode => $library->{branchcode}, categorycode => $category->{categorycode}, password => '34567890' ); >+ ok( $borr{borrowernumber}, 'Borrower hash contains borrowernumber' ); >+ is( $borr{cardnumber}, 12345, 'Borrower hash contains cardnumber' ); >+ $patron = Koha::Patrons->find( $borr{borrowernumber} ); >+ isnt( $patron, undef, 'Patron found' ); >+}; >+ >+$schema->storage->txn_rollback; >-- >2.1.4
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 12026
:
26769
|
26788
|
28408
|
30351
|
30352
|
30376
|
31054
|
31055
|
35551
|
35552
|
56241
|
56242
|
56243
|
57486
|
57563
|
57564
|
57565
|
57566
|
61268
|
61269
|
61270
|
61271
|
61363
|
61364
|
61365
|
61366
|
61367
|
61435
|
61436
|
61437
|
61438
|
61444
|
61445
|
61446
|
61447
|
61448
|
61449
|
61521
|
61522
|
61523
|
61524
|
61525
|
61526
|
61527
|
61596
|
61598
|
61599
|
61675
|
61676
|
61677
|
61678
|
61679
|
61680
|
61683
|
61684
|
62521
|
62522