|
Lines 25-32
use t::lib::TestBuilder;
Link Here
|
| 25 |
use Test::Warn; |
25 |
use Test::Warn; |
| 26 |
|
26 |
|
| 27 |
use C4::Context; |
27 |
use C4::Context; |
|
|
28 |
use C4::Auth; |
| 28 |
|
29 |
|
| 29 |
use Koha::Patrons; |
30 |
use Koha::Patrons; |
|
|
31 |
use Koha::DateUtils qw( dt_from_string ); |
| 30 |
|
32 |
|
| 31 |
# Hide all the subrouteine redefined warnings when running this test.. |
33 |
# Hide all the subrouteine redefined warnings when running this test.. |
| 32 |
# We reload the ldap module lots in the test and each reload triggers the |
34 |
# We reload the ldap module lots in the test and each reload triggers the |
|
Lines 155-161
subtest 'checkpw_ldap tests' => sub {
Link Here
|
| 155 |
|
157 |
|
| 156 |
subtest 'auth_by_bind = 1 tests' => sub { |
158 |
subtest 'auth_by_bind = 1 tests' => sub { |
| 157 |
|
159 |
|
| 158 |
plan tests => 14; |
160 |
plan tests => 15; |
| 159 |
|
161 |
|
| 160 |
$auth_by_bind = 1; |
162 |
$auth_by_bind = 1; |
| 161 |
|
163 |
|
|
Lines 272-277
subtest 'checkpw_ldap tests' => sub {
Link Here
|
| 272 |
$patron->delete; |
274 |
$patron->delete; |
| 273 |
$replicate = 0; |
275 |
$replicate = 0; |
| 274 |
$welcome = 0; |
276 |
$welcome = 0; |
|
|
277 |
|
| 278 |
# replicate testing with checkpw |
| 279 |
C4::Auth::checkpw( 'hola', password => 'hey' ); |
| 280 |
my $patron_replicated_from_auth = Koha::Patrons->search( { userid => 'hola' } )->next; |
| 281 |
is( $patron_replicated_from_auth->updated_on, dt_from_string()->ymd.' '.dt_from_string()->hms, "updated_on correctly saved on newly created user" ); |
| 282 |
|
| 283 |
$patron_replicated_from_auth->delete; |
| 284 |
|
| 275 |
$auth->unmock('ldap_entry_2_hash'); |
285 |
$auth->unmock('ldap_entry_2_hash'); |
| 276 |
# end replicate testing |
286 |
# end replicate testing |
| 277 |
|
287 |
|
|
Lines 499-504
sub mockedC4Config {
Link Here
|
| 499 |
my $class = shift; |
509 |
my $class = shift; |
| 500 |
my $param = shift; |
510 |
my $param = shift; |
| 501 |
|
511 |
|
|
|
512 |
if ( $param eq 'useldapserver' ) { |
| 513 |
return 1; |
| 514 |
} |
| 502 |
if ( $param eq 'useshibboleth' ) { |
515 |
if ( $param eq 'useshibboleth' ) { |
| 503 |
return 0; |
516 |
return 0; |
| 504 |
} |
517 |
} |
| 505 |
- |
|
|