Bugzilla – Attachment 92031 Details for
Bug 22741
Koha::Patron->store must not log updated_on changes (random failure of test BorrowerLogs and TrackLastPatronActivity)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22741: Add a test
Bug-22741-Add-a-test.patch (text/plain), 1.88 KB, created by
Jonathan Druart
on 2019-08-06 14:46:32 UTC
(
hide
)
Description:
Bug 22741: Add a test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-08-06 14:46:32 UTC
Size:
1.88 KB
patch
obsolete
>From 348363a22c5a30e487b71f38316b0207b2c71ae4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Aug 2019 09:44:40 -0500 >Subject: [PATCH] Bug 22741: Add a test > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Patrons.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 5b789d5c18..8f2c4069fc 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -26,11 +26,13 @@ use Test::MockModule; > use Time::Fake; > use DateTime; > use JSON; >+use Data::Dumper; > > use C4::Circulation; > use C4::Biblio; > use C4::Auth qw(checkpw_hash); > >+use Koha::ActionLogs; > use Koha::Holds; > use Koha::Old::Holds; > use Koha::Patrons; >@@ -1587,7 +1589,7 @@ subtest 'Test Koha::Patrons::merge' => sub { > }; > > subtest '->store' => sub { >- plan tests => 5; >+ plan tests => 6; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >@@ -1624,6 +1626,17 @@ subtest '->store' => sub { > > $schema->storage->dbh->{PrintError} = $print_error; > $schema->storage->txn_rollback; >+ >+ subtest 'skip updated_on for BorrowersLog' => sub { >+ plan tests => 1; >+ $schema->storage->txn_begin; >+ t::lib::Mocks::mock_preference('BorrowersLog', 1); >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ $patron->updated_on(dt_from_string($patron->updated_on)->add( seconds => 1 ))->store; >+ my $logs = Koha::ActionLogs->search({ module =>'MEMBERS', action => 'MODIFY', object => $patron->borrowernumber }); >+ is($logs->count, 0, '->store should not have generated a log for updated_on') or diag 'Log generated:'.Dumper($logs->unblessed); >+ $schema->storage->txn_rollback; >+ }; > }; > > subtest '->set_password' => sub { >-- >2.11.0
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 22741
:
90850
|
90877
|
92030
| 92031