|
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 => 146; |
3 |
use Test::More tests => 143; |
| 4 |
|
4 |
|
| 5 |
BEGIN { |
5 |
BEGIN { |
| 6 |
use_ok('C4::Budgets') |
6 |
use_ok('C4::Budgets') |
|
Lines 53-59
$bpid = AddBudgetPeriod({
Link Here
|
| 53 |
budget_period_enddate => '2008-12-31', |
53 |
budget_period_enddate => '2008-12-31', |
| 54 |
}); |
54 |
}); |
| 55 |
is( $bpid, undef, 'AddBugetPeriod without start date returns undef' ); |
55 |
is( $bpid, undef, 'AddBugetPeriod without start date returns undef' ); |
| 56 |
is( GetBudgetPeriod(0), undef ,'GetBudgetPeriod(0) returned undef : noactive BudgetPeriod' ); |
|
|
| 57 |
my $budgetperiods = GetBudgetPeriods(); |
56 |
my $budgetperiods = GetBudgetPeriods(); |
| 58 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
57 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
| 59 |
|
58 |
|
|
Lines 71-78
is( $budgetperiod->{budget_period_startdate}, $my_budgetperiod->{budget_period_s
Link Here
|
| 71 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'AddBudgetPeriod stores the end date correctly' ); |
70 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'AddBudgetPeriod stores the end date correctly' ); |
| 72 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'AddBudgetPeriod stores the description correctly' ); |
71 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'AddBudgetPeriod stores the description correctly' ); |
| 73 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'AddBudgetPeriod stores active correctly' ); |
72 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'AddBudgetPeriod stores active correctly' ); |
| 74 |
is( GetBudgetPeriod(0), undef ,'GetBudgetPeriod(0) returned undef : noactive BudgetPeriod' ); |
|
|
| 75 |
|
| 76 |
|
73 |
|
| 77 |
$my_budgetperiod = { |
74 |
$my_budgetperiod = { |
| 78 |
budget_period_startdate => '2009-01-01', |
75 |
budget_period_startdate => '2009-01-01', |
|
Lines 91-98
is( $budgetperiod->{budget_period_startdate}, $my_budgetperiod->{budget_period_s
Link Here
|
| 91 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'ModBudgetPeriod updates the end date correctly' ); |
88 |
is( $budgetperiod->{budget_period_enddate}, $my_budgetperiod->{budget_period_enddate}, 'ModBudgetPeriod updates the end date correctly' ); |
| 92 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'ModBudgetPeriod updates the description correctly' ); |
89 |
is( $budgetperiod->{budget_period_description}, $my_budgetperiod->{budget_period_description}, 'ModBudgetPeriod updates the description correctly' ); |
| 93 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'ModBudgetPeriod upates active correctly' ); |
90 |
is( $budgetperiod->{budget_period_active}, $my_budgetperiod->{budget_period_active}, 'ModBudgetPeriod upates active correctly' ); |
| 94 |
isnt( GetBudgetPeriod(0), undef, 'GetBugetPeriods functions correctly' ); |
|
|
| 95 |
|
| 96 |
|
91 |
|
| 97 |
$budgetperiods = GetBudgetPeriods(); |
92 |
$budgetperiods = GetBudgetPeriods(); |
| 98 |
is( @$budgetperiods, 1, 'GetBudgetPeriods returns the correct number of budget periods' ); |
93 |
is( @$budgetperiods, 1, 'GetBudgetPeriods returns the correct number of budget periods' ); |
|
Lines 106-112
is( DelBudgetPeriod($bpid), 1, 'DelBudgetPeriod returns true' );
Link Here
|
| 106 |
$budgetperiods = GetBudgetPeriods(); |
101 |
$budgetperiods = GetBudgetPeriods(); |
| 107 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
102 |
is( @$budgetperiods, 0, 'GetBudgetPeriods returns the correct number of budget periods' ); |
| 108 |
|
103 |
|
| 109 |
|
|
|
| 110 |
# |
104 |
# |
| 111 |
# Budget : |
105 |
# Budget : |
| 112 |
# |
106 |
# |
| 113 |
- |
|
|