View | Details | Raw Unified | Return to bug 32132
Collapse All | Expand All

(-)a/Koha/Acquisition/Fund.pm (+1 lines)
Lines 42-47 associated to the fund. Link Here
42
sub budget {
42
sub budget {
43
    my ( $self )  = @_;
43
    my ( $self )  = @_;
44
    my $budget_rs = $self->_result->budget;
44
    my $budget_rs = $self->_result->budget;
45
    return unless $budget_rs;
45
    return Koha::Acquisition::Budget->_new_from_dbic( $budget_rs );
46
    return Koha::Acquisition::Budget->_new_from_dbic( $budget_rs );
46
}
47
}
47
48
(-)a/t/db_dependent/Koha/Acquisition/Fund.t (-2 / +10 lines)
Lines 25-30 use t::lib::TestBuilder; Link Here
25
25
26
use Koha::Database;
26
use Koha::Database;
27
27
28
use Koha::Acquisition::Budget;
29
28
my $schema  = Koha::Database->schema;
30
my $schema  = Koha::Database->schema;
29
my $builder = t::lib::TestBuilder->new;
31
my $builder = t::lib::TestBuilder->new;
30
32
Lines 44-50 subtest 'to_api() tests' => sub { Link Here
44
};
46
};
45
47
46
subtest 'budget' => sub {
48
subtest 'budget' => sub {
47
    plan tests => 1;
49
    plan tests => 2;
48
50
49
    $schema->storage->txn_begin;
51
    $schema->storage->txn_begin;
50
    my $f = $builder->build_object(
52
    my $f = $builder->build_object(
Lines 57-61 subtest 'budget' => sub { Link Here
57
    is( ref( $fund->budget ),
59
    is( ref( $fund->budget ),
58
        'Koha::Acquisition::Budget',
60
        'Koha::Acquisition::Budget',
59
        '->fund should return a Koha::Acquisition::Budget object' );
61
        '->fund should return a Koha::Acquisition::Budget object' );
62
63
    # Testing when budget_period_id is set as NULL
64
    $fund->budget_period_id(undef);
65
    $fund->update();
66
    is( $fund->budget,
67
        undef,
68
        '->fund->budget should return undef if budget_period_id is set as NULL' );
60
    $schema->storage->txn_rollback;
69
    $schema->storage->txn_rollback;
61
};
70
};
62
- 

Return to bug 32132