Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 9; |
20 |
use Test::More tests => 8; |
21 |
|
21 |
|
22 |
use t::lib::TestBuilder; |
22 |
use t::lib::TestBuilder; |
23 |
|
23 |
|
Lines 310-334
subtest 'invoices' => sub {
Link Here
|
310 |
|
310 |
|
311 |
$schema->storage->txn_rollback(); |
311 |
$schema->storage->txn_rollback(); |
312 |
}; |
312 |
}; |
313 |
|
|
|
314 |
subtest 'to_api() tests' => sub { |
315 |
|
316 |
plan tests => 4; |
317 |
|
318 |
$schema->storage->txn_begin; |
319 |
|
320 |
my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); |
321 |
|
322 |
is( $vendor->interfaces->count, 0, 'Vendor has no interfaces' ); |
323 |
|
324 |
$vendor->interfaces( |
325 |
[ { name => 'first interface' }, { name => 'second interface', login => 'one_login', password => 'Test1234' } ] |
326 |
); |
327 |
|
328 |
my $interfaces = $vendor->to_api->{interfaces}; |
329 |
is( scalar(@$interfaces), 2, 'Vendor has two interfaces' ); |
330 |
is( @{$interfaces}[0]->{password}, undef, 'No password set for the interface' ); |
331 |
is( @{$interfaces}[1]->{password}, 'Test1234', 'password is unhashed' ); |
332 |
|
333 |
$schema->storage->txn_rollback; |
334 |
}; |
335 |
- |