Bugzilla – Attachment 147639 Details for
Bug 33104
Add vendor interfaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33104: Add tests
Bug-33104-Add-tests.patch (text/plain), 2.31 KB, created by
Jonathan Druart
on 2023-03-02 14:36:50 UTC
(
hide
)
Description:
Bug 33104: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-03-02 14:36:50 UTC
Size:
2.31 KB
patch
obsolete
>From 3673f51e8d0b0448174a20c4a87e724bf99c4fb6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Mar 2023 14:15:15 +0100 >Subject: [PATCH] Bug 33104: Add tests > >--- > t/db_dependent/Koha/Acquisition/Booksellers.t | 35 ++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t >index 1b6a5d4e1c0..32106b86c13 100755 >--- a/t/db_dependent/Koha/Acquisition/Booksellers.t >+++ b/t/db_dependent/Koha/Acquisition/Booksellers.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > > use t::lib::TestBuilder; > >@@ -192,3 +192,36 @@ subtest 'aliases' => sub { > > $schema->storage->txn_rollback(); > }; >+ >+subtest 'interfaces' => sub { >+ >+ plan tests => 11; >+ >+ $schema->storage->txn_begin(); >+ >+ my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); >+ >+ is( $vendor->interfaces->count, 0, 'Vendor has no interfaces' ); >+ >+ $vendor->interfaces( [ { name => 'first interface' }, { name => 'second interface', login => 'one_login' } ] ); >+ >+ $vendor = $vendor->get_from_storage; >+ my $interfaces = $vendor->interfaces; >+ is( $interfaces->count, 2, '2 interfaces stored' ); >+ is( ref($interfaces), 'Koha::Acquisition::Bookseller::Interfaces', 'Type is correct' ); >+ >+ $vendor->interfaces( [ { name => 'first interface', login => 'one_login', password => 'oneP@sswOrd' } ] ); >+ $vendor = $vendor->get_from_storage; >+ $interfaces = $vendor->interfaces; >+ is( $interfaces->count, 1, '1 interface stored' ); >+ my $interface = $interfaces->next; >+ is( $interface->name, 'first interface', 'name correctly saved' ); >+ is( $interface->login, 'one_login', 'login correctly saved' ); >+ is( $interface->uri, undef, 'no value is stored as NULL' ); >+ isnt( $interface->password, 'oneP@sswOrd', 'Password is not stored in plain text' ); >+ isnt( $interface->password, '', 'Password is not removed' ); >+ isnt( $interface->password, undef, 'Password is not set to NULL' ); >+ is( $interface->plain_text_password, 'oneP@sswOrd', 'Password can be retrieved using ->plain_text_password' ); >+ >+ $schema->storage->txn_rollback(); >+}; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33104
:
147632
|
147633
|
147634
|
147635
|
147636
|
147637
|
147638
|
147639
|
148459
|
148460
|
148461
|
148462
|
148463
|
148464
|
148465
|
148466
|
148473
|
148474
|
148475
|
148476
|
148477
|
148478
|
148479
|
148480
|
149375
|
149420
|
149421
|
149422
|
149431
|
149492
|
149493
|
149494
|
149495
|
149496
|
149497
|
149498
|
149499
|
149500
|
149501
|
149502
|
149503
|
149631
|
149632