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

(-)a/Koha/Objects.pm (-2 / +2 lines)
Lines 292-305 The autoload method is used call DBIx::Class method on a resultset. Link Here
292
292
293
Important: If you plan to use one of the DBIx::Class methods you must provide
293
Important: If you plan to use one of the DBIx::Class methods you must provide
294
relevant tests in t/db_dependent/Koha/Objects.t
294
relevant tests in t/db_dependent/Koha/Objects.t
295
Currently count, pager, reset, update and delete are covered.
295
Currently count, pager, update and delete are covered.
296
296
297
=cut
297
=cut
298
298
299
sub AUTOLOAD {
299
sub AUTOLOAD {
300
    my ( $self, @params ) = @_;
300
    my ( $self, @params ) = @_;
301
301
302
    my @known_methods = qw( count pager reset update delete result_class );
302
    my @known_methods = qw( count pager update delete result_class );
303
    my $method = our $AUTOLOAD;
303
    my $method = our $AUTOLOAD;
304
    $method =~ s/.*:://;
304
    $method =~ s/.*:://;
305
305
(-)a/t/db_dependent/Koha/Objects.t (-2 / +3 lines)
Lines 64-74 subtest 'pager' => sub { Link Here
64
};
64
};
65
65
66
subtest 'reset' => sub {
66
subtest 'reset' => sub {
67
    plan tests => 1;
67
    plan tests => 3;
68
68
69
    my $patrons = Koha::Patrons->search;
69
    my $patrons = Koha::Patrons->search;
70
    my $first_borrowernumber = $patrons->next->borrowernumber;
70
    my $first_borrowernumber = $patrons->next->borrowernumber;
71
    my $second_borrowernumber = $patrons->next->borrowernumber;
71
    my $second_borrowernumber = $patrons->next->borrowernumber;
72
    is( ref( $patrons->reset ), 'Koha::Patrons', 'Koha::Objects->reset should allow chaining' );
73
    is( ref( $patrons->reset->next ), 'Koha::Patron', 'Koha::Objects->reset should allow chaining' );
72
    is( $patrons->reset->next->borrowernumber, $first_borrowernumber, 'Koha::Objects->reset should work as expected');
74
    is( $patrons->reset->next->borrowernumber, $first_borrowernumber, 'Koha::Objects->reset should work as expected');
73
};
75
};
74
76
75
- 

Return to bug 17552