Bug 28998: Introduce Koha::Encryption
[koha.git] / t / db_dependent / Koha / Encryption.t
1 use Modern::Perl;
2
3 use Test::More tests => 1;
4 use Koha::Encryption;
5 use t::lib::Mocks;
6
7 t::lib::Mocks::mock_config('encryption_key', 'my secret passphrase');
8
9 my $string = 'a string to encrypt';
10
11 my $crypt = Koha::Encryption->new;
12 my $encrypted_string = $crypt->encrypt_hex($string);
13 is( $crypt->decrypt_hex($encrypted_string), $string, 'Decrypted to original text' );