From b36aeb172d1cd5aa582042d46993e9b7d188e129 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 11 Jul 2013 16:51:40 +0000 Subject: [PATCH] Bug 10535: (follow-up) add test case This adds a test case for the new default sort order for GetBudgets(). Signed-off-by: Galen Charlton Signed-off-by: Jared Camins-Esakov Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton (cherry picked from commit 5a384cc64367647aa519c196ae8927d309b1ec19) Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Budgets.t | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index 717f8fe42f..baaa1a198a 100755 --- a/t/db_dependent/Budgets.t +++ b/t/db_dependent/Budgets.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests=>18; +use Test::More tests=>20; BEGIN {use_ok('C4::Budgets') } use C4::Dates; @@ -102,5 +102,22 @@ ok(GetBudgets({budget_period_id=>GetBudgetPeriod($bpid)->{budget_period_id}},[{" my $budget_name = GetBudgetName( $budget_id ); is($budget_name, $budget->{budget_name}, "Test the GetBudgetName routine"); +my $second_budget_id; +ok($second_budget_id=AddBudget( + { budget_code => "ZZZZ", + budget_amount => "500.00", + budget_name => "Art", + budget_notes => "This is a note", + budget_description=> "Art", + budget_active => 1, + budget_period_id => $bpid, + } + ), + "AddBudget returned $second_budget_id"); + +my $budgets = GetBudgets({ budget_period_id => $bpid}); +ok($budgets->[0]->{budget_name} lt $budgets->[1]->{budget_name}, 'default sort order for GetBudgets is by name'); + ok($del_status=DelBudget($budget_id), "DelBudget returned $del_status"); + -- 2.39.5