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

(-)a/Koha/Illbackend.pm (-4 / +4 lines)
Lines 1-4 Link Here
1
package Koha::Illbackend;
1
package Koha::ILL::Backend;
2
2
3
# Copyright PTFS Europe 2023
3
# Copyright PTFS Europe 2023
4
#
4
#
Lines 23-35 use base qw(Koha::Object); Link Here
23
23
24
=head1 NAME
24
=head1 NAME
25
25
26
Koha::Illbackend - Koha Illbackend Object class
26
Koha::ILL::Backend - Koha Illbackend Object class
27
27
28
=head2 Class methods
28
=head2 Class methods
29
29
30
=head3 new
30
=head3 new
31
31
32
New illbackend
32
New ILL Backend
33
33
34
=cut
34
=cut
35
35
Lines 127-133 sub embed { Link Here
127
127
128
=head3 _type
128
=head3 _type
129
129
130
    my $type = Koha::Illbackend->_type;
130
    my $type = Koha::ILL::Backend->_type;
131
131
132
Return this object's type
132
Return this object's type
133
133
(-)a/Koha/REST/V1/Illbackends.pm (-6 / +6 lines)
Lines 1-4 Link Here
1
package Koha::REST::V1::Illbackends;
1
package Koha::REST::V1::ILL::Backends;
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
Lines 21-31 use Mojo::Base 'Mojolicious::Controller'; Link Here
21
21
22
use Koha::Illrequest::Config;
22
use Koha::Illrequest::Config;
23
use Koha::Illrequests;
23
use Koha::Illrequests;
24
use Koha::Illbackend;
24
use Koha::ILL::Backend;
25
25
26
=head1 NAME
26
=head1 NAME
27
27
28
Koha::REST::V1::Illbackends
28
Koha::REST::V1::ILL::Backends
29
29
30
=head2 Operations
30
=head2 Operations
31
31
Lines 66-83 sub get { Link Here
66
66
67
    return try {
67
    return try {
68
68
69
        #FIXME: Should we move load_backend into Koha::Illbackend...
69
        #FIXME: Should we move load_backend into Koha::ILL::Backend...
70
        #       or maybe make Koha::Ill::Backend a base class for all
70
        #       or maybe make Koha::Ill::Backend a base class for all
71
        #       backends?
71
        #       backends?
72
        my $backend = Koha::Illrequest->new->load_backend($backend_id);
72
        my $backend = Koha::Illrequest->new->load_backend($backend_id);
73
73
74
        my $backend_module = Koha::Illbackend->new;
74
        my $backend_module = Koha::ILL::Backend->new;
75
75
76
        my $embed =
76
        my $embed =
77
          $backend_module->embed( $backend_id,
77
          $backend_module->embed( $backend_id,
78
            $c->req->headers->header('x-koha-embed') );
78
            $c->req->headers->header('x-koha-embed') );
79
79
80
        #TODO: We need a to_api method in Koha::Illbackend
80
        #TODO: We need a to_api method in Koha::ILL::Backend
81
        my $return = {
81
        my $return = {
82
            ill_backend_id => $backend_id,
82
            ill_backend_id => $backend_id,
83
            capabilities   => $backend->capabilities,
83
            capabilities   => $backend->capabilities,
(-)a/api/v1/swagger/paths/ill_backends.yaml (-4 / +4 lines)
Lines 1-8 Link Here
1
---
1
---
2
/ill/backends:
2
/ill/backends:
3
  get:
3
  get:
4
    x-mojo-to: Illbackends#list
4
    x-mojo-to: ILL::Backends#list
5
    operationId: listIllbackends
5
    operationId: listIllBackends
6
    tags:
6
    tags:
7
      - ill_backends
7
      - ill_backends
8
    summary: List ILL backends
8
    summary: List ILL backends
Lines 42-49 Link Here
42
        ill: "1"
42
        ill: "1"
43
"/ill/backends/{ill_backend_id}":
43
"/ill/backends/{ill_backend_id}":
44
  get:
44
  get:
45
    x-mojo-to: Illbackends#get
45
    x-mojo-to: ILL::Backends#get
46
    operationId: getIllbackends
46
    operationId: getIllBackends
47
    tags:
47
    tags:
48
      - ill_backends
48
      - ill_backends
49
    summary: Get ILL backend
49
    summary: Get ILL backend
(-)a/t/db_dependent/Koha/Illbackend.t (-4 / +3 lines)
Lines 21-27 use Modern::Perl; Link Here
21
21
22
use Test::More tests => 1;
22
use Test::More tests => 1;
23
23
24
use Koha::Illbackend;
24
use Koha::ILL::Backend;
25
25
26
use t::lib::TestBuilder;
26
use t::lib::TestBuilder;
27
use t::lib::Mocks;
27
use t::lib::Mocks;
Lines 36-42 subtest 'existing_statuses() tests' => sub { Link Here
36
    $schema->storage->txn_begin;
36
    $schema->storage->txn_begin;
37
    Koha::Illrequests->search->delete;
37
    Koha::Illrequests->search->delete;
38
38
39
    # Mock ILLBackend (as object)
39
    # Mock external ILLBackend (as object)
40
    my $backend = Test::MockObject->new;
40
    my $backend = Test::MockObject->new;
41
    $backend->set_isa('Koha::Illbackends::Mock');
41
    $backend->set_isa('Koha::Illbackends::Mock');
42
    $backend->set_always( 'name', 'Mock' );
42
    $backend->set_always( 'name', 'Mock' );
Lines 133-139 subtest 'existing_statuses() tests' => sub { Link Here
133
        }
133
        }
134
    );
134
    );
135
135
136
    my $backend_module = Koha::Illbackend->new;
136
    my $backend_module = Koha::ILL::Backend->new;
137
137
138
    my $existing_statuses = $backend_module->existing_statuses('Mock');
138
    my $existing_statuses = $backend_module->existing_statuses('Mock');
139
139
140
- 

Return to bug 35581