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

(-)a/t/db_dependent/Auth.t (-4 / +27 lines)
Lines 42-48 $schema->storage->txn_begin; Link Here
42
42
43
subtest 'checkauth() tests' => sub {
43
subtest 'checkauth() tests' => sub {
44
44
45
    plan tests => 10;
45
    plan tests => 11;
46
46
47
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } });
47
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } });
48
48
Lines 138-148 subtest 'checkauth() tests' => sub { Link Here
138
138
139
    };
139
    };
140
140
141
    subtest 'Template params tests (password_expired)' => sub {
141
    subtest 'sessionID should be passed to the template for auth' => sub {
142
142
143
        plan tests => 1;
143
        plan tests => 1;
144
144
145
        my $password_expired;
145
        subtest 'hit auth.tt' => sub {
146
147
            plan tests => 1;
148
149
            my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } );
150
151
            my $password = set_weak_password($patron);
152
153
            my $cgi_mock = Test::MockModule->new('CGI');
154
            $cgi_mock->mock( 'request_method', sub { return 'POST' } );
155
            my $cgi = CGI->new;
156
157
            # Simulating the login form submission
158
            $cgi->param( 'userid',   $patron->userid );
159
            $cgi->param( 'password', $password );
160
161
            my ( $userid, $cookie, $sessionID, $flags, $template ) =
162
                C4::Auth::checkauth( $cgi, 0, { catalogue => 1 }, 'intranet', undef, undef, { do_not_print => 1 } );
163
            ok( $template->{VARS}->{sessionID} );
164
        };
165
    };
166
167
    subtest 'Template params tests (password_expired)' => sub {
168
169
        plan tests => 1;
146
170
147
        my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
171
        my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
148
172
149
- 

Return to bug 36092