|
Lines 39-44
use Test::DBIx::Class;
Link Here
|
| 39 |
# Mock Variables |
39 |
# Mock Variables |
| 40 |
my $matchpoint = 'userid'; |
40 |
my $matchpoint = 'userid'; |
| 41 |
my $autocreate = 0; |
41 |
my $autocreate = 0; |
|
|
42 |
my $sync = 0; |
| 42 |
my %mapping = ( |
43 |
my %mapping = ( |
| 43 |
'userid' => { 'is' => 'uid' }, |
44 |
'userid' => { 'is' => 'uid' }, |
| 44 |
'surname' => { 'is' => 'sn' }, |
45 |
'surname' => { 'is' => 'sn' }, |
|
Lines 156-162
subtest "get_login_shib tests" => sub {
Link Here
|
| 156 |
|
157 |
|
| 157 |
## checkpw_shib |
158 |
## checkpw_shib |
| 158 |
subtest "checkpw_shib tests" => sub { |
159 |
subtest "checkpw_shib tests" => sub { |
| 159 |
plan tests => 18; |
160 |
plan tests => 21; |
| 160 |
|
161 |
|
| 161 |
my $shib_login; |
162 |
my $shib_login; |
| 162 |
my ( $retval, $retcard, $retuserid ); |
163 |
my ( $retval, $retcard, $retuserid ); |
|
Lines 214-219
subtest "checkpw_shib tests" => sub {
Link Here
|
| 214 |
'Found $new_users surname'; |
215 |
'Found $new_users surname'; |
| 215 |
$autocreate = 0; |
216 |
$autocreate = 0; |
| 216 |
|
217 |
|
|
|
218 |
# sync user |
| 219 |
$sync = 1; |
| 220 |
$ENV{'city'} = 'AnotherCity'; |
| 221 |
warnings_are { |
| 222 |
( $retval, $retcard, $retuserid ) = checkpw_shib($shib_login); |
| 223 |
} |
| 224 |
[], "good user with sync"; |
| 225 |
|
| 226 |
ok my $sync_user = ResultSet('Borrower') |
| 227 |
->search( { 'userid' => 'test4321' }, { rows => 1 } ), "sync user found"; |
| 228 |
|
| 229 |
is_fields [qw/surname dateexpiry address city/], $sync_user->next, |
| 230 |
[qw/pika 2017 Address AnotherCity/], |
| 231 |
'Found $sync_user synced city'; |
| 232 |
$sync = 0; |
| 233 |
|
| 217 |
# debug on |
234 |
# debug on |
| 218 |
$C4::Auth_with_shibboleth::debug = '1'; |
235 |
$C4::Auth_with_shibboleth::debug = '1'; |
| 219 |
|
236 |
|
|
Lines 280-285
sub mockedConfig {
Link Here
|
| 280 |
|
297 |
|
| 281 |
my %shibboleth = ( |
298 |
my %shibboleth = ( |
| 282 |
'autocreate' => $autocreate, |
299 |
'autocreate' => $autocreate, |
|
|
300 |
'sync' => $sync, |
| 283 |
'matchpoint' => $matchpoint, |
301 |
'matchpoint' => $matchpoint, |
| 284 |
'mapping' => \%mapping |
302 |
'mapping' => \%mapping |
| 285 |
); |
303 |
); |
|
Lines 306-311
sub mockedSchema {
Link Here
|
| 306 |
sub reset_config { |
324 |
sub reset_config { |
| 307 |
$matchpoint = 'userid'; |
325 |
$matchpoint = 'userid'; |
| 308 |
$autocreate = 0; |
326 |
$autocreate = 0; |
|
|
327 |
$sync = 0; |
| 309 |
%mapping = ( |
328 |
%mapping = ( |
| 310 |
'userid' => { 'is' => 'uid' }, |
329 |
'userid' => { 'is' => 'uid' }, |
| 311 |
'surname' => { 'is' => 'sn' }, |
330 |
'surname' => { 'is' => 'sn' }, |
| 312 |
- |
|
|