Lines 1-6
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
use Modern::Perl; |
2 |
use Modern::Perl; |
3 |
use Test::More tests => 147; |
3 |
use Test::More tests => 154; |
4 |
use JSON; |
4 |
use JSON; |
5 |
|
5 |
|
6 |
BEGIN { |
6 |
BEGIN { |
Lines 589-597
is($budget_hierarchy->[0]->{budget_level},'0','budget_level of budget (budget_1)
Link Here
|
589 |
is($budget_hierarchy->[0]->{children}->[0]->{budget_level},'1','budget_level of first fund(budget_11) should be 1'); |
589 |
is($budget_hierarchy->[0]->{children}->[0]->{budget_level},'1','budget_level of first fund(budget_11) should be 1'); |
590 |
is($budget_hierarchy->[0]->{children}->[1]->{budget_level},'1','budget_level of second fund(budget_12) should be 1'); |
590 |
is($budget_hierarchy->[0]->{children}->[1]->{budget_level},'1','budget_level of second fund(budget_12) should be 1'); |
591 |
is($budget_hierarchy->[0]->{children}->[0]->{children}->[0]->{budget_level},'2','budget_level of child fund budget_11 should be 2'); |
591 |
is($budget_hierarchy->[0]->{children}->[0]->{children}->[0]->{budget_level},'2','budget_level of child fund budget_11 should be 2'); |
|
|
592 |
|
593 |
#Test skiptotals |
594 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id, undef, undef, 1); |
595 |
is( $budget_hierarchy->[0]->{children}->[0]->{budget_name}, 'budget_11', 'GetBudgetHierarchy skiptotals should return budgets ordered by name, first child is budget_11' ); |
596 |
is( $budget_hierarchy->[0]->{children}->[1]->{budget_name}, 'budget_12', 'GetBudgetHierarchy skiptotals should return budgets ordered by name, second child is budget_12' ); |
597 |
is($budget_hierarchy->[0]->{budget_name},'budget_1','GetBudgetHierarchy skiptotals should return budgets ordered by name, first budget is budget_1'); |
598 |
is($budget_hierarchy->[0]->{budget_level},'0','skiptotals: budget_level of budget (budget_1) should be 0'); |
599 |
is($budget_hierarchy->[0]->{children}->[0]->{budget_level},'1','skiptotals: budget_level of first fund(budget_11) should be 1'); |
600 |
is($budget_hierarchy->[0]->{children}->[1]->{budget_level},'1','skiptotals: budget_level of second fund(budget_12) should be 1'); |
601 |
is($budget_hierarchy->[0]->{children}->[0]->{children}->[0]->{budget_level},'2','skiptotals: budget_level of child fund budget_11 should be 2'); |
602 |
|
592 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
603 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
593 |
$budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); |
604 |
$budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); |
594 |
|
|
|
595 |
is( scalar(@$budget_hierarchy_cloned), scalar(@$budget_hierarchy), |
605 |
is( scalar(@$budget_hierarchy_cloned), scalar(@$budget_hierarchy), |
596 |
'CloneBudgetPeriod (with inactive param) clones the same number of budgets (funds)' |
606 |
'CloneBudgetPeriod (with inactive param) clones the same number of budgets (funds)' |
597 |
); |
607 |
); |
598 |
- |
|
|