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

(-)a/Koha/Objects.pm (+2 lines)
Lines 240-248 Currently count, pager, reset and update are covered. Link Here
240
sub AUTOLOAD {
240
sub AUTOLOAD {
241
    my ( $self, @params ) = @_;
241
    my ( $self, @params ) = @_;
242
242
243
    my @known_methods = qw( count pager reset update );
243
    my $method = our $AUTOLOAD;
244
    my $method = our $AUTOLOAD;
244
    $method =~ s/.*:://;
245
    $method =~ s/.*:://;
245
246
247
    carp "The method $method is not covered by tests" and return unless grep {/^$method$/} @known_methods;
246
    my $r = eval { $self->_resultset->$method(@params) };
248
    my $r = eval { $self->_resultset->$method(@params) };
247
    if ( $@ ) {
249
    if ( $@ ) {
248
        carp "No method $method found for " . ref($self) . " " . $@;
250
        carp "No method $method found for " . ref($self) . " " . $@;
(-)a/t/db_dependent/Koha/Objects.t (-2 / +7 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 5;
22
use Test::More tests => 6;
23
use Test::Warn;
23
24
24
use Koha::Authority::Types;
25
use Koha::Authority::Types;
25
use Koha::Cities;
26
use Koha::Cities;
Lines 66-70 subtest 'reset' => sub { Link Here
66
    is( $patrons->reset->next->borrowernumber, $first_borrowernumber, 'Koha::Objects->reset should work as expected');
67
    is( $patrons->reset->next->borrowernumber, $first_borrowernumber, 'Koha::Objects->reset should work as expected');
67
};
68
};
68
69
70
subtest 'not_covered_yet' => sub {
71
    plan tests => 1;
72
    warning_is { Koha::Patrons->search->not_covered_yet } { carped => 'The method not_covered_yet is not covered by tests' }, "If a method is not covered by tests, the AUTOLOAD method won't execute the method";
73
};
74
69
$schema->storage->txn_rollback;
75
$schema->storage->txn_rollback;
70
1;
76
1;
71
- 

Return to bug 17091