Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 15; |
22 |
use Test::More tests => 16; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
|
25 |
|
Lines 1107-1109
subtest 'recalls() tests' => sub {
Link Here
|
1107 |
|
1107 |
|
1108 |
$schema->storage->txn_rollback; |
1108 |
$schema->storage->txn_rollback; |
1109 |
}; |
1109 |
}; |
1110 |
- |
1110 |
|
|
|
1111 |
subtest 'encode_secret and decoded_secret' => sub { |
1112 |
plan tests => 5; |
1113 |
$schema->storage->txn_begin; |
1114 |
|
1115 |
t::lib::Mocks::mock_config('encryption_key', 't0P_secret'); |
1116 |
|
1117 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
1118 |
is( $patron->decoded_secret, undef, 'TestBuilder does not initialize it' ); |
1119 |
$patron->secret(q{}); |
1120 |
is( $patron->decoded_secret, q{}, 'Empty string case' ); |
1121 |
|
1122 |
$patron->encode_secret('encrypt_me'); # Note: lazy testing; should be base32 string normally. |
1123 |
is( length($patron->secret) > 0, 1, 'Secret length' ); |
1124 |
isnt( $patron->secret, 'encrypt_me', 'Encrypted column' ); |
1125 |
is( $patron->decoded_secret, 'encrypt_me', 'Decrypted column' ); |
1126 |
|
1127 |
$schema->storage->txn_rollback; |
1128 |
}; |