Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
There is really no need for all those modules here. What remains, is just a trivial test. Test plan: Run t/SuggestionEngine_AuthorityFile.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit80db256a47
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit5fd2fe48b9
) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
8d10a8ca3d
commit
11a64807e6
1 changed files with 2 additions and 25 deletions
|
@ -20,30 +20,10 @@
|
|||
# for every call to SearchAuthorities
|
||||
|
||||
use Modern::Perl;
|
||||
|
||||
use File::Spec;
|
||||
use MARC::Record;
|
||||
|
||||
use Test::More;
|
||||
use Test::More tests => 2;
|
||||
use Test::MockModule;
|
||||
use t::lib::Mocks;
|
||||
|
||||
use Module::Load::Conditional qw/check_install/;
|
||||
|
||||
BEGIN {
|
||||
if ( check_install( module => 'Test::DBIx::Class' ) ) {
|
||||
plan tests => 3;
|
||||
} else {
|
||||
plan skip_all => "Need Test::DBIx::Class"
|
||||
}
|
||||
}
|
||||
|
||||
# Mock the DB connexion
|
||||
use Test::DBIx::Class;
|
||||
my $db = Test::MockModule->new('Koha::Database');
|
||||
$db->mock( _new_schema => sub { return Schema(); } );
|
||||
|
||||
use_ok('Koha::SuggestionEngine');
|
||||
use Koha::SuggestionEngine;
|
||||
|
||||
my $module = Test::MockModule->new('C4::AuthoritiesMarc');
|
||||
$module->mock('SearchAuthorities', sub {
|
||||
|
@ -68,6 +48,3 @@ is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
|
|||
my $result = $suggestor->get_suggestions({search => 'Cookery'});
|
||||
|
||||
is_deeply($result, [ { 'search' => 'an:1234', 'relevance' => 1, 'label' => 'Cooking' } ], "Suggested correct alternative to 'Cookery'");
|
||||
|
||||
done_testing();
|
||||
|
||||
|
|
Loading…
Reference in a new issue