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

(-)a/Koha/Object.pm (-1 / +1 lines)
Lines 246-252 sub AUTOLOAD { Link Here
246
        }
246
        }
247
    }
247
    }
248
248
249
    my @known_methods = qw( is_changed id in_storage get_column );
249
    my @known_methods = qw( is_changed id in_storage get_column discard_changes);
250
250
251
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
251
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
252
252
(-)a/t/db_dependent/Koha/Object.t (-2 / +15 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 6;
20
use Test::More tests => 7;
21
use Test::Warn;
21
use Test::Warn;
22
22
23
use C4::Context;
23
use C4::Context;
Lines 89-92 subtest 'get_column' => sub { Link Here
89
    my $patron = Koha::Patron->new({categorycode => $categorycode, branchcode => $branchcode })->store;
89
    my $patron = Koha::Patron->new({categorycode => $categorycode, branchcode => $branchcode })->store;
90
    is( $patron->get_column('borrowernumber'), $patron->borrowernumber, 'get_column should retrieve the correct value' );
90
    is( $patron->get_column('borrowernumber'), $patron->borrowernumber, 'get_column should retrieve the correct value' );
91
};
91
};
92
93
subtest 'discard_changes' => sub {
94
    plan tests => 1;
95
    my $builder = t::lib::TestBuilder->new;
96
    my $patron = $builder->build( { source => 'Borrower' } );
97
    $patron->dateexpiry(dt_from_string);
98
    $patron->discard_changes;
99
    is(
100
        $patron->dateexpiry,
101
        dt_from_string->truncate( to => 'day' ),
102
        'discard_changes should refresh the object'
103
    );
104
};
105
92
1;
106
1;
93
- 

Return to bug 17594