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> Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
2f4e57b20f
commit
22f1f3a26a
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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'} );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue