From d9112e70efc5c095c0eb50507b7597e3c3b1cf1b Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Tue, 7 Feb 2017 09:49:34 +0000 Subject: [PATCH] Added unit tests to patch https://bugs.koha-community.org/show_bug.cgi?id=15408 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- t/db_dependent/Budgets.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index e28e20c..1d9bcad 100755 --- a/t/db_dependent/Budgets.t +++ b/t/db_dependent/Budgets.t @@ -1,6 +1,6 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 145; +use Test::More tests => 146; BEGIN { use_ok('C4::Budgets') @@ -14,6 +14,7 @@ use Koha::Acquisition::Orders; use Koha::Patrons; use t::lib::TestBuilder; +use Koha::DateUtils; use YAML; @@ -488,6 +489,19 @@ my $budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( 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}; +warn $test; +my $budget_time = Koha::DateUtils::dt_from_string($test); +my $local_time = Koha::DateUtils::dt_from_string(); +warn $budget_time; +warn $local_time; + + +is(DateTime::compare($budget_time, $local_time), 0); + + + my $budget_hierarchy = GetBudgetHierarchy($budget_period_id); my $budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); -- 2.1.4