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

(-)a/t/db_dependent/Koha/Account/Line.t (-2 / +29 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 14;
22
use Test::More tests => 15;
23
use Test::Exception;
23
use Test::Exception;
24
use Test::MockModule;
24
use Test::MockModule;
25
25
Lines 66-71 subtest 'patron() tests' => sub { Link Here
66
    $schema->storage->txn_rollback;
66
    $schema->storage->txn_rollback;
67
};
67
};
68
68
69
subtest 'manager() tests' => sub {
70
71
    plan tests => 3;
72
73
    $schema->storage->txn_begin;
74
75
    my $library = $builder->build( { source => 'Branch' } );
76
    my $manager = $builder->build( { source => 'Borrower' } );
77
78
    my $line = Koha::Account::Line->new(
79
    {
80
        manager_id      => $manager->{borrowernumber},
81
        debit_type_code => "OVERDUE",
82
        status          => "RETURNED",
83
        amount          => 10,
84
        interface       => 'commandline',
85
    })->store;
86
87
    my $account_line_manager = $line->manager;
88
    is( ref( $account_line_manager ), 'Koha::Patron', 'Koha::Account::Line->manager should return a Koha::Patron' );
89
    is( $line->manager_id, $account_line_manager->borrowernumber, 'Koha::Account::Line->manager should return the correct staff' );
90
91
    $line->manager_id(undef)->store;
92
    is( $line->manager, undef, 'Koha::Account::Line->manager should return undef if no staff linked' );
93
94
    $schema->storage->txn_rollback;
95
};
96
69
subtest 'item() tests' => sub {
97
subtest 'item() tests' => sub {
70
98
71
    plan tests => 3;
99
    plan tests => 3;
72
- 

Return to bug 22435