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

(-)a/t/db_dependent/Koha/Account.t (-3 / +16 lines)
Lines 34-39 use t::lib::TestBuilder; Link Here
34
my $schema  = Koha::Database->new->schema;
34
my $schema  = Koha::Database->new->schema;
35
my $builder = t::lib::TestBuilder->new;
35
my $builder = t::lib::TestBuilder->new;
36
36
37
subtest 'new' => sub {
38
39
    plan tests => 2;
40
41
    $schema->storage->txn_begin;
42
43
    throws_ok { Koha::Account->new(); } { carped => qr/No patron id passed in!/ }, 'Croaked on bad call to new';
44
45
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
46
    $account = Koha::Account->new( { patron_id => $patron->borrowernumber } );
47
    is( defined $account, 1, "Account is defined" );
48
49
    $schema->storage->txn_rollback;
50
};
51
37
subtest 'outstanding_debits() tests' => sub {
52
subtest 'outstanding_debits() tests' => sub {
38
53
39
    plan tests => 22;
54
    plan tests => 22;
Lines 141-147 subtest 'outstanding_credits() tests' => sub { Link Here
141
156
142
subtest 'add_credit() tests' => sub {
157
subtest 'add_credit() tests' => sub {
143
158
144
    plan tests => 16;
159
    plan tests => 15;
145
160
146
    $schema->storage->txn_begin;
161
    $schema->storage->txn_begin;
147
162
Lines 151-157 subtest 'add_credit() tests' => sub { Link Here
151
166
152
    my $patron  = $builder->build_object( { class => 'Koha::Patrons' } );
167
    my $patron  = $builder->build_object( { class => 'Koha::Patrons' } );
153
    my $account = Koha::Account->new( { patron_id => $patron->borrowernumber } );
168
    my $account = Koha::Account->new( { patron_id => $patron->borrowernumber } );
154
    is( defined $account, 1, "Account is defined" );
155
169
156
    is( $account->balance, 0, 'Patron has no balance' );
170
    is( $account->balance, 0, 'Patron has no balance' );
157
171
158
- 

Return to bug 21692