Lines 22-27
subtest 'new' => sub {
Link Here
|
22 |
$schema->storage->txn_begin; |
22 |
$schema->storage->txn_begin; |
23 |
|
23 |
|
24 |
t::lib::Mocks::mock_preference('TwoFactorAuthentication', 1); |
24 |
t::lib::Mocks::mock_preference('TwoFactorAuthentication', 1); |
|
|
25 |
t::lib::Mocks::mock_config('encryption_key', 'bad_example'); |
25 |
|
26 |
|
26 |
# Trivial test: no patron, no object |
27 |
# Trivial test: no patron, no object |
27 |
throws_ok { Koha::Auth::TwoFactorAuth->new; } |
28 |
throws_ok { Koha::Auth::TwoFactorAuth->new; } |
Lines 63-68
subtest 'qr_code' => sub {
Link Here
|
63 |
$schema->storage->txn_begin; |
64 |
$schema->storage->txn_begin; |
64 |
|
65 |
|
65 |
t::lib::Mocks::mock_preference('TwoFactorAuthentication', 1); |
66 |
t::lib::Mocks::mock_preference('TwoFactorAuthentication', 1); |
|
|
67 |
t::lib::Mocks::mock_config('encryption_key', 'bad_example'); |
66 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
68 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
67 |
$patron->encode_secret('you2wont2guess2it'); # this is base32 btw |
69 |
$patron->encode_secret('you2wont2guess2it'); # this is base32 btw |
68 |
$patron->auth_method('two-factor'); |
70 |
$patron->auth_method('two-factor'); |