Bugzilla – Attachment 150127 Details for
Bug 29046
Allow libraries to specify email order for "AutoEmailPrimaryAddress"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29046: Unit tests
Bug-29046-Unit-tests.patch (text/plain), 3.16 KB, created by
Katrin Fischer
on 2023-04-23 11:42:03 UTC
(
hide
)
Description:
Bug 29046: Unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-04-23 11:42:03 UTC
Size:
3.16 KB
patch
obsolete
>From 02241cb3c29c0d0559d5c05e2cc64354d1542acd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 20 Apr 2023 14:18:20 +0100 >Subject: [PATCH] Bug 29046: Unit tests > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Patron.t | 28 +++++++++++++++++++++++++++- > t/db_dependent/Koha/Patrons.t | 16 +--------------- > 2 files changed, 28 insertions(+), 16 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 6007589ae9..f04bb1404b 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 23; > use Test::Exception; > use Test::Warn; > >@@ -1351,6 +1351,32 @@ subtest 'notify_library_of_registration()' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'notice_email_address' => sub { >+ plan tests => 2; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ >+ t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'email|emailpro' ); >+ t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'OFF' ); >+ is ($patron->notice_email_address, $patron->email, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is off"); >+ >+ t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'emailpro' ); >+ is ($patron->notice_email_address, $patron->emailpro, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is emailpro"); >+ >+ $patron->delete; >+}; >+ >+subtest 'first_valid_email_address' => sub { >+ plan tests => 1; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { emailpro => ''}}); >+ >+ t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'emailpro|email' ); >+ is ($patron->first_valid_email_address, $patron->email, "Koha::Patron->first_valid_email_address returns correct value when EmailFieldPrecedence is 'emailpro|email' and emailpro is empty"); >+ >+ $patron->delete; >+}; >+ > subtest 'get_savings tests' => sub { > > plan tests => 4; >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 187b18c379..567ff118dd 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 44; >+use Test::More tests => 43; > use Test::Warn; > use Test::Exception; > use Test::MockModule; >@@ -1061,20 +1061,6 @@ subtest 'holds and old_holds' => sub { > $patron->delete; > }; > >-subtest 'notice_email_address' => sub { >- plan tests => 2; >- >- my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >- >- t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'OFF' ); >- is ($patron->notice_email_address, $patron->email, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is off"); >- >- t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'emailpro' ); >- is ($patron->notice_email_address, $patron->emailpro, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is emailpro"); >- >- $patron->delete; >-}; >- > subtest 'search_patrons_to_anonymise' => sub { > > plan tests => 5; >-- >2.30.2
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 29046
:
148054
|
148055
|
148056
|
148057
|
148145
|
148146
|
148147
|
148155
|
149385
|
149386
|
149387
|
149959
|
149960
|
149961
|
149962
|
149963
|
150124
|
150125
|
150126
| 150127 |
150128
|
150129