Lines 43-48
use Test::DBIx::Class {
Link Here
|
43 |
# Mock Variables |
43 |
# Mock Variables |
44 |
my $matchpoint = 'userid'; |
44 |
my $matchpoint = 'userid'; |
45 |
my $autocreate = 0; |
45 |
my $autocreate = 0; |
|
|
46 |
my $sync = 0; |
46 |
my %mapping = ( |
47 |
my %mapping = ( |
47 |
'userid' => { 'is' => 'uid' }, |
48 |
'userid' => { 'is' => 'uid' }, |
48 |
'surname' => { 'is' => 'sn' }, |
49 |
'surname' => { 'is' => 'sn' }, |
Lines 165-171
subtest "get_login_shib tests" => sub {
Link Here
|
165 |
|
166 |
|
166 |
## checkpw_shib |
167 |
## checkpw_shib |
167 |
subtest "checkpw_shib tests" => sub { |
168 |
subtest "checkpw_shib tests" => sub { |
168 |
plan tests => 18; |
169 |
plan tests => 21; |
169 |
|
170 |
|
170 |
my $shib_login; |
171 |
my $shib_login; |
171 |
my ( $retval, $retcard, $retuserid ); |
172 |
my ( $retval, $retcard, $retuserid ); |
Lines 223-228
subtest "checkpw_shib tests" => sub {
Link Here
|
223 |
'Found $new_users surname'; |
224 |
'Found $new_users surname'; |
224 |
$autocreate = 0; |
225 |
$autocreate = 0; |
225 |
|
226 |
|
|
|
227 |
# sync user |
228 |
$sync = 1; |
229 |
$ENV{'city'} = 'AnotherCity'; |
230 |
warnings_are { |
231 |
( $retval, $retcard, $retuserid ) = checkpw_shib($shib_login); |
232 |
} |
233 |
[], "good user with sync"; |
234 |
|
235 |
ok my $sync_user = ResultSet('Borrower') |
236 |
->search( { 'userid' => 'test4321' }, { rows => 1 } ), "sync user found"; |
237 |
|
238 |
is_fields [qw/surname dateexpiry address city/], $sync_user->next, |
239 |
[qw/pika 2017 Address AnotherCity/], |
240 |
'Found $sync_user synced city'; |
241 |
$sync = 0; |
242 |
|
226 |
# debug on |
243 |
# debug on |
227 |
$C4::Auth_with_shibboleth::debug = '1'; |
244 |
$C4::Auth_with_shibboleth::debug = '1'; |
228 |
|
245 |
|
Lines 315-320
sub mockedConfig {
Link Here
|
315 |
|
332 |
|
316 |
my %shibboleth = ( |
333 |
my %shibboleth = ( |
317 |
'autocreate' => $autocreate, |
334 |
'autocreate' => $autocreate, |
|
|
335 |
'sync' => $sync, |
318 |
'matchpoint' => $matchpoint, |
336 |
'matchpoint' => $matchpoint, |
319 |
'mapping' => \%mapping |
337 |
'mapping' => \%mapping |
320 |
); |
338 |
); |
Lines 349-354
sub mockedSchema {
Link Here
|
349 |
sub reset_config { |
367 |
sub reset_config { |
350 |
$matchpoint = 'userid'; |
368 |
$matchpoint = 'userid'; |
351 |
$autocreate = 0; |
369 |
$autocreate = 0; |
|
|
370 |
$sync = 0; |
352 |
%mapping = ( |
371 |
%mapping = ( |
353 |
'userid' => { 'is' => 'uid' }, |
372 |
'userid' => { 'is' => 'uid' }, |
354 |
'surname' => { 'is' => 'sn' }, |
373 |
'surname' => { 'is' => 'sn' }, |
355 |
- |
|
|