Lines 17-22
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
|
|
20 |
use utf8; |
20 |
use Test::More tests => 8; |
21 |
use Test::More tests => 8; |
21 |
|
22 |
|
22 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
Lines 218-224
subtest 'interfaces' => sub {
Link Here
|
218 |
is( $interfaces->count, 2, '2 interfaces stored' ); |
219 |
is( $interfaces->count, 2, '2 interfaces stored' ); |
219 |
is( ref($interfaces), 'Koha::Acquisition::Bookseller::Interfaces', 'Type is correct' ); |
220 |
is( ref($interfaces), 'Koha::Acquisition::Bookseller::Interfaces', 'Type is correct' ); |
220 |
|
221 |
|
221 |
$vendor->interfaces( [ { name => 'first interface', login => 'one_login', password => 'oneP@sswOrd' } ] ); |
222 |
$vendor->interfaces( [ { name => 'first interface', login => 'one_login', password => 'oneP@sswOrd❤' } ] ); |
222 |
$vendor = $vendor->get_from_storage; |
223 |
$vendor = $vendor->get_from_storage; |
223 |
$interfaces = $vendor->interfaces; |
224 |
$interfaces = $vendor->interfaces; |
224 |
is( $interfaces->count, 1, '1 interface stored' ); |
225 |
is( $interfaces->count, 1, '1 interface stored' ); |
Lines 226-235
subtest 'interfaces' => sub {
Link Here
|
226 |
is( $interface->name, 'first interface', 'name correctly saved' ); |
227 |
is( $interface->name, 'first interface', 'name correctly saved' ); |
227 |
is( $interface->login, 'one_login', 'login correctly saved' ); |
228 |
is( $interface->login, 'one_login', 'login correctly saved' ); |
228 |
is( $interface->uri, undef, 'no value is stored as NULL' ); |
229 |
is( $interface->uri, undef, 'no value is stored as NULL' ); |
229 |
isnt( $interface->password, 'oneP@sswOrd', 'Password is not stored in plain text' ); |
230 |
isnt( $interface->password, 'oneP@sswOrd❤', 'Password is not stored in plain text' ); |
230 |
isnt( $interface->password, '', 'Password is not removed' ); |
231 |
isnt( $interface->password, '', 'Password is not removed' ); |
231 |
isnt( $interface->password, undef, 'Password is not set to NULL' ); |
232 |
isnt( $interface->password, undef, 'Password is not set to NULL' ); |
232 |
is( $interface->plain_text_password, 'oneP@sswOrd', 'Password can be retrieved using ->plain_text_password' ); |
233 |
is( $interface->plain_text_password, 'oneP@sswOrd❤', 'Password can be retrieved using ->plain_text_password' ); |
233 |
|
234 |
|
234 |
$schema->storage->txn_rollback(); |
235 |
$schema->storage->txn_rollback(); |
235 |
}; |
236 |
}; |
236 |
- |
|
|