View | Details | Raw Unified | Return to bug 38526
Collapse All | Expand All

(-)a/t/db_dependent/Auth_with_ldap.t (-3 / +4 lines)
Lines 20-28 use Modern::Perl; Link Here
20
use Test::More tests => 4;
20
use Test::More tests => 4;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::MockObject;
22
use Test::MockObject;
23
use Test::Warn;
24
23
use t::lib::Mocks;
25
use t::lib::Mocks;
24
use t::lib::TestBuilder;
26
use t::lib::TestBuilder;
25
use Test::Warn;
27
use t::lib::Dates;
26
28
27
use C4::Context;
29
use C4::Context;
28
use C4::Auth;
30
use C4::Auth;
Lines 276-286 subtest 'checkpw_ldap tests' => sub { Link Here
276
        $welcome   = 0;
278
        $welcome   = 0;
277
279
278
        # replicate testing with checkpw
280
        # replicate testing with checkpw
279
        my $time_now = dt_from_string()->ymd . ' ' . dt_from_string()->hms;
280
        C4::Auth::checkpw( 'hola', password => 'hey' );
281
        C4::Auth::checkpw( 'hola', password => 'hey' );
281
        my $patron_replicated_from_auth = Koha::Patrons->search( { userid => 'hola' } )->next;
282
        my $patron_replicated_from_auth = Koha::Patrons->search( { userid => 'hola' } )->next;
282
        is(
283
        is(
283
            $patron_replicated_from_auth->updated_on, $time_now,
284
            t::lib::Dates::compare( $patron_replicated_from_auth->updated_on, dt_from_string ), 0,
284
            "updated_on correctly saved on newly created user"
285
            "updated_on correctly saved on newly created user"
285
        );
286
        );
286
287
(-)a/t/db_dependent/Auth_with_shibboleth.t (-8 / +7 lines)
Lines 29-34 use File::Temp qw(tempdir); Link Here
29
use t::lib::Mocks;
29
use t::lib::Mocks;
30
use t::lib::Mocks::Logger;
30
use t::lib::Mocks::Logger;
31
use t::lib::TestBuilder;
31
use t::lib::TestBuilder;
32
use t::lib::Dates;
32
33
33
use C4::Auth_with_shibboleth qw( shib_ok login_shib_url get_login_shib checkpw_shib );
34
use C4::Auth_with_shibboleth qw( shib_ok login_shib_url get_login_shib checkpw_shib );
34
use Koha::Database;
35
use Koha::Database;
Lines 309-323 subtest "checkpw_shib tests" => sub { Link Here
309
    $ENV{'emailpro'} = 'me@myemail.com';
310
    $ENV{'emailpro'} = 'me@myemail.com';
310
    $ENV{branchcode} = $library->branchcode;      # needed since T::D::C does no longer hides the FK constraint
311
    $ENV{branchcode} = $library->branchcode;      # needed since T::D::C does no longer hides the FK constraint
311
312
312
    my $time_now = dt_from_string()->ymd . ' ' . dt_from_string()->hms;
313
    checkpw($shib_login);
313
    checkpw($shib_login);
314
    ok my $new_user_autocreated = $schema->resultset('Borrower')->search( { 'userid' => 'test43210' }, { rows => 1 } ),
314
    ok(
315
        "new user found";
315
        my $new_user_autocreated = Koha::Patrons->find( { userid => 'test43210' } ),
316
        "new user found"
317
    );
316
318
317
    my $rec_autocreated = $new_user_autocreated->next;
319
    is(
318
    is_deeply(
320
        t::lib::Dates::compare( $new_user_autocreated->updated_on, dt_from_string ), 0,
319
        [ map { $rec_autocreated->$_ } qw/updated_on/ ],
320
        [$time_now],
321
        'updated_on correctly saved on newly created user'
321
        'updated_on correctly saved on newly created user'
322
    );
322
    );
323
};
323
};
324
- 

Return to bug 38526