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 => 144; |
4 |
|
4 |
|
5 |
BEGIN { |
5 |
BEGIN { |
6 |
use_ok('C4::Budgets') |
6 |
use_ok('C4::Budgets') |
Lines 58-64
$bpid = AddBudgetPeriod({
Link Here
|
58 |
budget_period_enddate => '2008-12-31', |
58 |
budget_period_enddate => '2008-12-31', |
59 |
}); |
59 |
}); |
60 |
is( $bpid, undef, 'AddBugetPeriod without start date returns undef' ); |
60 |
is( $bpid, undef, 'AddBugetPeriod without start date returns undef' ); |
61 |
is( GetBudgetPeriod(0), undef ,'GetBudgetPeriod(0) returned undef : noactive BudgetPeriod' ); |
|
|
62 |
my $budgetperiods = GetBudgetPeriods(); |
61 |
my $budgetperiods = GetBudgetPeriods(); |
63 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
62 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
64 |
|
63 |
|
Lines 76-83
is( $budgetperiod->{budget_period_startdate}, $my_budgetperiod->{budget_period_s
Link Here
|
76 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'AddBudgetPeriod stores the end date correctly' ); |
75 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'AddBudgetPeriod stores the end date correctly' ); |
77 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'AddBudgetPeriod stores the description correctly' ); |
76 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'AddBudgetPeriod stores the description correctly' ); |
78 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'AddBudgetPeriod stores active correctly' ); |
77 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'AddBudgetPeriod stores active correctly' ); |
79 |
is( GetBudgetPeriod(0), undef ,'GetBudgetPeriod(0) returned undef : noactive BudgetPeriod' ); |
|
|
80 |
|
81 |
|
78 |
|
82 |
$my_budgetperiod = { |
79 |
$my_budgetperiod = { |
83 |
budget_period_startdate => '2009-01-01', |
80 |
budget_period_startdate => '2009-01-01', |
Lines 96-103
is( $budgetperiod->{budget_period_startdate}, $my_budgetperiod->{budget_period_s
Link Here
|
96 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'ModBudgetPeriod updates the end date correctly' ); |
93 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'ModBudgetPeriod updates the end date correctly' ); |
97 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'ModBudgetPeriod updates the description correctly' ); |
94 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'ModBudgetPeriod updates the description correctly' ); |
98 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'ModBudgetPeriod upates active correctly' ); |
95 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'ModBudgetPeriod upates active correctly' ); |
99 |
isnt( GetBudgetPeriod(0), undef, 'GetBugetPeriods functions correctly' ); |
|
|
100 |
|
101 |
|
96 |
|
102 |
$budgetperiods = GetBudgetPeriods(); |
97 |
$budgetperiods = GetBudgetPeriods(); |
103 |
is( @$budgetperiods, 1, 'GetBudgetPeriods returns the correct number of budget periods' ); |
98 |
is( @$budgetperiods, 1, 'GetBudgetPeriods returns the correct number of budget periods' ); |
Lines 111-117
is( DelBudgetPeriod($bpid), 1, 'DelBudgetPeriod returns true' );
Link Here
|
111 |
$budgetperiods = GetBudgetPeriods(); |
106 |
$budgetperiods = GetBudgetPeriods(); |
112 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
107 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
113 |
|
108 |
|
114 |
|
|
|
115 |
# |
109 |
# |
116 |
# Budget : |
110 |
# Budget : |
117 |
# |
111 |
# |
118 |
- |
|
|