Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 16; |
22 |
use Test::More tests => 17; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
|
25 |
|
Lines 1137-1139
subtest 'recalls() tests' => sub {
Link Here
|
1137 |
|
1137 |
|
1138 |
$schema->storage->txn_rollback; |
1138 |
$schema->storage->txn_rollback; |
1139 |
}; |
1139 |
}; |
1140 |
- |
1140 |
|
|
|
1141 |
subtest 'encode_secret and decoded_secret' => sub { |
1142 |
plan tests => 5; |
1143 |
$schema->storage->txn_begin; |
1144 |
|
1145 |
t::lib::Mocks::mock_config('encryption_key', 't0P_secret'); |
1146 |
|
1147 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
1148 |
is( $patron->decoded_secret, undef, 'TestBuilder does not initialize it' ); |
1149 |
$patron->secret(q{}); |
1150 |
is( $patron->decoded_secret, q{}, 'Empty string case' ); |
1151 |
|
1152 |
$patron->encode_secret('encrypt_me'); # Note: lazy testing; should be base32 string normally. |
1153 |
is( length($patron->secret) > 0, 1, 'Secret length' ); |
1154 |
isnt( $patron->secret, 'encrypt_me', 'Encrypted column' ); |
1155 |
is( $patron->decoded_secret, 'encrypt_me', 'Decrypted column' ); |
1156 |
|
1157 |
$schema->storage->txn_rollback; |
1158 |
}; |