Bugzilla – Attachment 77542 Details for
Bug 15408
Timestamp on funds not updated when you duplicate a budget
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15408: Fix tests to fail without patch
Bug-15408-Fix-tests-to-fail-without-patch.patch (text/plain), 1.99 KB, created by
Jonathan Druart
on 2018-08-07 19:10:16 UTC
(
hide
)
Description:
Bug 15408: Fix tests to fail without patch
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-08-07 19:10:16 UTC
Size:
1.99 KB
patch
obsolete
>From 164fcbe66ef4f7e536ed2936408c465f271a0134 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 7 Aug 2018 13:37:30 +0000 >Subject: [PATCH] Bug 15408: Fix tests to fail without patch > >We set all the timestamps to a specified date and ensure the new budgets >don't have this date > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Budgets.t | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index 32e077d6e0..ec14e11369 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -11,6 +11,7 @@ use C4::Acquisition; > > use Koha::Acquisition::Booksellers; > use Koha::Acquisition::Orders; >+use Koha::Acquisition::Funds; > use Koha::Patrons; > > use t::lib::TestBuilder; >@@ -477,6 +478,12 @@ is ( GetBudgetOrdered( $fund ), '20', "total ordered price is 20"); > > > # CloneBudgetPeriod >+# Let's make sure our timestamp is old >+my @orig_funds = Koha::Acquisition::Funds->search({ budget_period_id => $budget_period_id }); >+foreach my $fund (@orig_funds){ >+ $fund->timestamp('1999-12-31 23:59:59')->store; >+} >+ > my $budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( > { > budget_period_id => $budget_period_id, >@@ -490,12 +497,9 @@ my $budget_period_cloned = C4::Budgets::GetBudgetPeriod($budget_period_id_cloned > is($budget_period_cloned->{budget_period_description}, 'Budget Period Cloned', 'Cloned budget\'s description is updated.'); > > my $budget_cloned = C4::Budgets::GetBudgets({ budget_period_id => $budget_period_id_cloned }); >-my $test = $budget_cloned->[0]->{timestamp}; >-my $budget_time = Koha::DateUtils::dt_from_string($test); >-my $local_time = Koha::DateUtils::dt_from_string(); >- >+my $budget_time = $budget_cloned->[0]->{timestamp}; > >-is(DateTime::compare($budget_time, $local_time), 0, "New budget got the right timestamp"); >+isnt($budget_time, '1999-12-31 23:59:59', "New budget has an updated timestamp"); > > > >-- >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 15408
:
59886
|
59887
|
59890
|
59974
|
60244
|
60337
|
60338
|
60339
|
62985
|
62986
|
62987
|
65181
|
65182
|
65183
|
77524
|
77525
|
77526
|
77527
|
77539
|
77540
|
77541
| 77542