Bugzilla – Attachment 72608 Details for
Bug 18626
Add ability to track cardnumber changes for patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18626: Add unit tests
Bug-18626-Add-unit-tests.patch (text/plain), 1.40 KB, created by
Kyle M Hall (khall)
on 2018-03-09 14:52:22 UTC
(
hide
)
Description:
Bug 18626: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-09 14:52:22 UTC
Size:
1.40 KB
patch
obsolete
>From 4d682c3c5d5bf48dabfd271123dc40279488e320 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatetsolutions.com> >Date: Fri, 9 Mar 2018 09:51:52 -0500 >Subject: [PATCH] Bug 18626: Add unit tests > >--- > t/db_dependent/Koha/Patrons.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 2323d21..451bd79 100644 >--- 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 => 25; >+use Test::More tests => 26; > use Test::Warn; > use Time::Fake; > use DateTime; >@@ -1121,6 +1121,20 @@ subtest 'is_child | is_adult' => sub { > $retrieved_patron_1->delete; > is( Koha::Patrons->search->count, $nb_of_patrons + 1, 'Delete should have deleted the patron' ); > >+subtest 'Log cardnumber change' => sub { >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); >+ my $patron = $builder->build( { source => 'Borrower' } ); >+ >+ $patron->{cardnumber} = 'TESTCARDNUMBER'; >+ ModMember(%$patron); >+ >+ my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'MODIFY', object => $patron->{borrowernumber} } )->count; >+ is( $number_of_logs, 2, 'With BorrowerLogs, Change in cardnumbder should be logged.' ); >+}; >+ >+ > $schema->storage->txn_rollback; > > # TODO Move to t::lib::Mocks and reuse it! >-- >2.10.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 18626
:
63532
|
63560
|
69467
|
72607
|
72608
|
72609