Bugzilla – Attachment 101038 Details for
Bug 24151
Add a pseudonymization process for patrons and transactions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24151: Add tests - if config does not exist
Bug-24151-Add-tests---if-config-does-not-exist.patch (text/plain), 2.38 KB, created by
Jonathan Druart
on 2020-03-19 16:24:13 UTC
(
hide
)
Description:
Bug 24151: Add tests - if config does not exist
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-19 16:24:13 UTC
Size:
2.38 KB
patch
obsolete
>From 43aae0ed8e579d95d21d7f0e6f260a65dd503aff Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 30 Nov 2019 12:48:04 +0100 >Subject: [PATCH] Bug 24151: Add tests - if config does not exist > >Sponsored-by: Association KohaLa - https://koha-fr.org/ > >Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> >--- > t/db_dependent/Koha/Pseudonymization.t | 40 ++++++++++++++++++++++++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Pseudonymization.t b/t/db_dependent/Koha/Pseudonymization.t >index 99f6e2d40c..6c8031224b 100644 >--- a/t/db_dependent/Koha/Pseudonymization.t >+++ b/t/db_dependent/Koha/Pseudonymization.t >@@ -19,9 +19,11 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; >+use Try::Tiny; > > use C4::Circulation; >+use C4::Stats; > > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); >@@ -34,7 +36,41 @@ use t::lib::Mocks; > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >-subtest 'Koha::PseudonymizedTransactions tests' => sub { >+subtest 'Config does not exist' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_config( 'key', '' ); >+ t::lib::Mocks::mock_preference( 'Pseudonymization', 1 ); >+ t::lib::Mocks::mock_preference( 'PseudonymizationPatronFields', 'branchcode,categorycode,sort1' ); >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $item = $builder->build_sample_item; >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ try{ >+ C4::Stats::UpdateStats( >+ { >+ type => 'issue', >+ branch => 'BBB', >+ itemnumber => $item->itemnumber, >+ borrowernumber => $patron->borrowernumber, >+ itemtype => $item->effective_itemtype, >+ location => $item->location, >+ } >+ ); >+ >+ } catch { >+ ok($_->isa('Koha::Exceptions::Config::MissingEntry'), "Koha::Patron->store should raise a Koha::Exceptions::Config::MissingEntry if 'key' is not defined in the config"); >+ is( $_->message, "Missing 'key' entry in config file"); >+ }; >+ >+ $schema->storage->txn_rollback; >+}; >+ >+subtest 'Koha::Anonymized::Transactions tests' => sub { > > plan tests => 11; > >-- >2.20.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 24151
:
95959
|
95960
|
95961
|
95962
|
95963
|
95964
|
95965
|
95966
|
95967
|
95968
|
95969
|
95970
|
95971
|
95972
|
95973
|
95974
|
95975
|
95976
|
97240
|
97241
|
97242
|
97243
|
97244
|
97245
|
97246
|
97247
|
97248
|
97249
|
97250
|
97251
|
97252
|
101034
|
101035
|
101036
|
101037
|
101038
|
101039
|
101040
|
101041
|
101042
|
101043
|
101044
|
101045
|
101046
|
101047
|
101048
|
101049
|
105801
|
105802
|
105803
|
105804
|
105805
|
105806
|
105807
|
105808
|
105809
|
105810
|
105811
|
105812
|
105813
|
105814
|
105815
|
105816
|
106032
|
106033
|
106034
|
106035
|
106036
|
106037
|
106038
|
106039
|
106040
|
106041
|
106042
|
106043
|
106044
|
106045
|
106046
|
106047
|
106048
|
106049
|
106195
|
106255
|
107127
|
107225