Bug 21567: Remove Koha_ExternalContent_RecordedBooks.t
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 14 Nov 2018 18:11:07 +0000 (15:11 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 16 Nov 2018 13:04:58 +0000 (13:04 +0000)
This patch removes this file. The included tests are similar to those in
the db_dependent section, with the difference that this have some things
mocked. But the tests still require name resolution and connecting to
the RB servers. This situation breaks package building without any
noticeable gain.

The feature could be better tested by mocking WebService::ILS calls (so
no external world contact), but it belongs to a separate bug report.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

t/Koha_ExternalContent_RecordedBooks.t [deleted file]

diff --git a/t/Koha_ExternalContent_RecordedBooks.t b/t/Koha_ExternalContent_RecordedBooks.t
deleted file mode 100755 (executable)
index 7fdbfaa..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env perl
-
-use Modern::Perl;
-
-use t::lib::Mocks;
-use Test::More;
-use Test::MockModule;
-
-use Module::Load::Conditional qw( can_load );
-
-plan tests => 3;
-
-SKIP: {
-    skip "cannot find WebService::ILS::RecordedBooks::Partner", 3
-      unless can_load( modules => { 'WebService::ILS::RecordedBooks::Patron' => undef } );
-
-    use_ok('Koha::ExternalContent::RecordedBooks');
-
-    t::lib::Mocks::mock_preference('SessionStorage','tmp');
-
-    t::lib::Mocks::mock_preference('RecordedBooksLibraryID', 'DUMMY');
-    t::lib::Mocks::mock_preference('RecordedBooksClientSecret', 'DUMMY');
-    t::lib::Mocks::mock_preference('RecordedBooksDomain', 'DUMMY');
-
-    my $client = Koha::ExternalContent::RecordedBooks->new();
-    local $@;
-    eval { $client->search({query => "art"}) };
-
-    ok($@ =~ /This endpoint can be called by authorized trusted app or trusted partner only/, "Invalid RecordedBooks partner credentials");
-
-    SKIP: {
-        skip "no RecordedBooks partner credentials", 1 unless $ENV{RECORDEDBOOKS_TEST_LIBRARY_ID};
-
-        t::lib::Mocks::mock_preference('RecordedBooksLibraryID', $ENV{RECORDEDBOOKS_TEST_LIBRARY_ID});
-        t::lib::Mocks::mock_preference('RecordedBooksClientSecret', $ENV{RECORDEDBOOKS_TEST_CLIENT_SECRET});
-        t::lib::Mocks::mock_preference('RecordedBooksDomain', $ENV{RECORDEDBOOKS_TEST_DOMAIN});
-
-        $client = Koha::ExternalContent::RecordedBooks->new();
-        my $res = $client->search({query => "art"});
-        ok($res->{items}, "search")
-    }
-}