Bugzilla – Attachment 52115 Details for
Bug 10459
borrowers should have a timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10459: Add tests for borrowers.updated_on
Bug-10459-Add-tests-for-borrowersupdatedon.patch (text/plain), 2.03 KB, created by
Jonathan Druart
on 2016-06-07 09:21:47 UTC
(
hide
)
Description:
Bug 10459: Add tests for borrowers.updated_on
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-07 09:21:47 UTC
Size:
2.03 KB
patch
obsolete
>From 8d89992f96236a96a81c5526839395cb57dd1372 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 7 Jun 2016 10:20:53 +0100 >Subject: [PATCH] Bug 10459: Add tests for borrowers.updated_on > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Patrons.t | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t >index b22a6e8..24707df 100755 >--- a/t/db_dependent/Patrons.t >+++ b/t/db_dependent/Patrons.t >@@ -17,11 +17,12 @@ > > use Modern::Perl; > >-use Test::More tests => 13; >+use Test::More tests => 17; > use Test::Warn; > > use C4::Context; > use Koha::Database; >+use Koha::DateUtils; > > BEGIN { > use_ok('Koha::Objects'); >@@ -57,17 +58,27 @@ my $b2 = Koha::Patron->new( > } > ); > $b2->store(); >+my $three_days_ago = dt_from_string->add( days => -3 ); > my $b3 = Koha::Patron->new( > { > surname => 'Test 3', > branchcode => $branchcode, >- categorycode => $categorycode >+ categorycode => $categorycode, >+ updated_on => $three_days_ago, > } > ); > $b3->store(); > > my $b1_new = Koha::Patrons->find( $b1->borrowernumber() ); > is( $b1->surname(), $b1_new->surname(), "Found matching patron" ); >+isnt( $b1_new->updated_on, undef, "borrowers.updated_on should be set" ); >+is( dt_from_string($b1_new->updated_on), dt_from_string, "borrowers.updated_on should have been set to now on creating" ); >+ >+my $b3_new = Koha::Patrons->find( $b3->borrowernumber() ); >+is( dt_from_string($b3_new->updated_on), $three_days_ago, "borrowers.updated_on should have been kept to what we set on creating" ); >+$b3_new->set({ surname => 'another surname for Test 3' }); >+$b3_new = Koha::Patrons->find( $b3->borrowernumber() ); >+is( dt_from_string($b1_new->updated_on), dt_from_string, "borrowers.updated_on should have been set to now on updating" ); > > my @patrons = Koha::Patrons->search( { branchcode => $branchcode } ); > is( @patrons, 3, "Found 3 patrons with Search" ); >-- >2.8.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 10459
:
33421
|
33424
|
33435
|
33490
|
33491
|
33509
|
50475
|
50476
|
50478
|
50479
|
50480
|
50481
|
51807
|
51808
|
51809
|
51810
|
51842
|
51843
|
51844
|
51867
|
51868
|
52113
|
52114
| 52115 |
52294