Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
'Koha::Exceptions::Object::PropertyNotFound' => {
isa => 'Koha::Exceptions::Object',
description => "Invalid property",
- }
+ },
+ 'Koha::Exceptions::Object::MethodNotCoveredByTests' => {
+ isa => 'Koha::Exceptions::Object',
+ description => "Method not covered by tests",
+ },
);
1;
my @known_methods = qw( is_changed id in_storage get_column );
- carp "The method $method is not covered by tests or does not exist!" and return unless grep {/^$method$/} @known_methods;
+ Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
my $r = eval { $self->_result->$method(@_) };
if ( $@ ) {
use Modern::Perl;
-use Test::More tests => 9;
+use Test::More tests => 10;
use Test::Warn;
use Koha::Authority::Types;
try {
$patron->blah('blah');
} catch {
- ok( $_->isa('Koha::Exceptions::Object::MethodNotFound'),
- 'Calling a non-existent method should raise a Koha::Exceptions::Object::MethodNotFound exception' );
+ ok( $_->isa('Koha::Exceptions::Object::MethodNotCoveredByTests'),
+ 'Calling a non-covered method should raise a Koha::Exceptions::Object::MethodNotCoveredByTests exception' );
};
try {