Lines 138-144
can_ok(
Link Here
|
138 |
|
138 |
|
139 |
subtest 'checkpw_ldap tests' => sub { |
139 |
subtest 'checkpw_ldap tests' => sub { |
140 |
|
140 |
|
141 |
plan tests => 5; |
141 |
plan tests => 6; |
142 |
|
142 |
|
143 |
## Connection fail tests |
143 |
## Connection fail tests |
144 |
$desired_connection_result = 'error'; |
144 |
$desired_connection_result = 'error'; |
Lines 433-438
qr/LDAP Auth rejected : invalid password for user 'hola'./,
Link Here
|
433 |
|
433 |
|
434 |
$schema->storage->txn_rollback; |
434 |
$schema->storage->txn_rollback; |
435 |
}; |
435 |
}; |
|
|
436 |
|
437 |
subtest "!update && !replica return values" => sub { |
438 |
|
439 |
plan tests => 4; |
440 |
|
441 |
$schema->storage->txn_begin; |
442 |
|
443 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
444 |
|
445 |
# avoid noise |
446 |
t::lib::Mocks::mock_preference( 'ExtendedPatronAttributes', 0 ); |
447 |
$welcome = 0; |
448 |
|
449 |
# the scenario |
450 |
$replicate = 0; |
451 |
$update = 0; |
452 |
|
453 |
$anonymous_bind = 0; |
454 |
$desired_count_result = 1; |
455 |
$desired_authentication_result = 'success'; |
456 |
$desired_admin_bind_result = 'success'; |
457 |
$desired_search_result = 'success'; |
458 |
$desired_bind_result = 'success'; |
459 |
reload_ldap_module(); |
460 |
|
461 |
my ( $ret_val, $ret_cardnumber, $ret_userid, $ret_patron ) = |
462 |
C4::Auth_with_ldap::checkpw_ldap( $patron->userid, password => 'hey' ); |
463 |
|
464 |
is( $ret_val, 1 ); |
465 |
is( $ret_cardnumber, $patron->cardnumber ); |
466 |
is( $ret_userid, $patron->userid ); |
467 |
is( $ret_patron->id, $patron->id ); |
468 |
|
469 |
$schema->storage->txn_rollback; |
470 |
}; |
436 |
}; |
471 |
}; |
437 |
|
472 |
|
438 |
subtest 'search_method tests' => sub { |
473 |
subtest 'search_method tests' => sub { |
439 |
- |
|
|