Bugzilla – Attachment 87576 Details for
Bug 21975
Unnecessary substitutions in automatic item modification by age
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21975: add Unit Test
Bug-21975-add-Unit-Test.patch (text/plain), 1.92 KB, created by
Martin Renvoize (ashimema)
on 2019-04-09 06:28:01 UTC
(
hide
)
Description:
Bug 21975: add Unit Test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-09 06:28:01 UTC
Size:
1.92 KB
patch
obsolete
>From 404a2fe75775f9dacd7578faded3561eae5eeeb1 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 7 Dec 2018 15:21:48 +0100 >Subject: [PATCH] Bug 21975: add Unit Test > >Added missing transaction rollback > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Items/AutomaticItemModificationByAge.t | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t >index fad82fc67c..d81c9e2e36 100644 >--- a/t/db_dependent/Items/AutomaticItemModificationByAge.t >+++ b/t/db_dependent/Items/AutomaticItemModificationByAge.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 16; >+use Test::More tests => 17; > use MARC::Record; > use MARC::Field; > use DateTime; >@@ -12,6 +12,7 @@ use C4::Biblio; > use C4::Context; > use Koha::DateUtils; > use Koha::Items; >+use t::lib::Mocks; > use t::lib::TestBuilder; > > my $schema = Koha::Database->new->schema; >@@ -297,9 +298,16 @@ C4::Items::ToggleNewStatus( { rules => \@rules } ); > $modified_item = Koha::Items->find( $itemnumber ); > is( $modified_item->new_status, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|); > >-# Clear cache >+# Run twice >+t::lib::Mocks::mock_preference('CataloguingLog', 1); >+my $actions_nb = $schema->resultset('ActionLog')->count(); >+C4::Items::ToggleNewStatus( { rules => \@rules } ); >+is( $schema->resultset('ActionLog')->count(), $actions_nb, q|ToggleNewStatus: no substitution does not generate action logs|); >+ >+# Cleanup > $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); > $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); >+$schema->storage->txn_rollback; >-- >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 21975
:
82983
|
82984
|
82985
|
87575
|
87576
|
87577
|
87876
|
87877
|
87879
|
87880
|
87881
|
87882
|
87883
|
87889
|
87890
|
87891
|
87892
|
87893