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

(-)a/Koha/Exceptions/Object.pm (-1 / +5 lines)
Lines 14-20 use Exception::Class ( Link Here
14
    'Koha::Exceptions::Object::PropertyNotFound' => {
14
    'Koha::Exceptions::Object::PropertyNotFound' => {
15
        isa => 'Koha::Exceptions::Object',
15
        isa => 'Koha::Exceptions::Object',
16
        description => "Invalid property",
16
        description => "Invalid property",
17
    }
17
    },
18
    'Koha::Exceptions::Object::MethodNotCoveredByTests' => {
19
        isa => 'Koha::Exceptions::Object',
20
        description => "Method not covered by tests",
21
    },
18
);
22
);
19
23
20
1;
24
1;
(-)a/Koha/Object.pm (-1 / +1 lines)
Lines 239-245 sub AUTOLOAD { Link Here
239
239
240
    my @known_methods = qw( is_changed id in_storage get_column );
240
    my @known_methods = qw( is_changed id in_storage get_column );
241
241
242
    carp "The method $method is not covered by tests or does not exist!" and return unless grep {/^$method$/} @known_methods;
242
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
243
243
244
    my $r = eval { $self->_result->$method(@_) };
244
    my $r = eval { $self->_result->$method(@_) };
245
    if ( $@ ) {
245
    if ( $@ ) {
(-)a/t/db_dependent/Koha/Objects.t (-3 / +2 lines)
Lines 93-100 subtest 'Exceptions' => sub { Link Here
93
    try {
93
    try {
94
        $patron->blah('blah');
94
        $patron->blah('blah');
95
    } catch {
95
    } catch {
96
        ok( $_->isa('Koha::Exceptions::Object::MethodNotFound'),
96
        ok( $_->isa('Koha::Exceptions::Object::MethodNotCoveredByTests'),
97
            'Calling a non-existent method should raise a Koha::Exceptions::Object::MethodNotFound exception' );
97
            'Calling a non-covered method should raise a Koha::Exceptions::Object::MethodNotCoveredByTests exception' );
98
    };
98
    };
99
99
100
    try {
100
    try {
101
- 

Return to bug 17425