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

(-)a/Koha/NorwegianPatronDB.pm (-4 / +3 lines)
Lines 79-85 our %EXPORT_TAGS = ( all => [qw( Link Here
79
Exporter::export_ok_tags('all');
79
Exporter::export_ok_tags('all');
80
80
81
my $nl_uri   = 'http://lanekortet.no';
81
my $nl_uri   = 'http://lanekortet.no';
82
my $nl_proxy =  C4::Context->preference("NorwegianPatronDBEndpoint");
83
82
84
=head2 SOAP::Transport::HTTP::Client::get_basic_credentials
83
=head2 SOAP::Transport::HTTP::Client::get_basic_credentials
85
84
Lines 156-162 sub NLSearch { Link Here
156
    my $client = SOAP::Lite
155
    my $client = SOAP::Lite
157
        ->on_action( sub { return '""';})
156
        ->on_action( sub { return '""';})
158
        ->uri( $nl_uri )
157
        ->uri( $nl_uri )
159
        ->proxy( $nl_proxy );
158
        ->proxy( C4::Context->preference("NorwegianPatronDBEndpoint") );
160
159
161
    my $id = SOAP::Data->type('string');
160
    my $id = SOAP::Data->type('string');
162
    $id->name('identifikator');
161
    $id->name('identifikator');
Lines 236-242 sub NLSync { Link Here
236
    my $client = SOAP::Lite
235
    my $client = SOAP::Lite
237
        ->on_action( sub { return '""';})
236
        ->on_action( sub { return '""';})
238
        ->uri( $nl_uri )
237
        ->uri( $nl_uri )
239
        ->proxy( $nl_proxy );
238
        ->proxy( C4::Context->preference("NorwegianPatronDBEndpoint") );
240
239
241
    my $cardnumber = SOAP::Data->name( 'lnr' => $patron->cardnumber );
240
    my $cardnumber = SOAP::Data->name( 'lnr' => $patron->cardnumber );
242
241
Lines 289-295 sub NLGetChanged { Link Here
289
    my $client = SOAP::Lite
288
    my $client = SOAP::Lite
290
        ->on_action( sub { return '""';})
289
        ->on_action( sub { return '""';})
291
        ->uri( $nl_uri )
290
        ->uri( $nl_uri )
292
        ->proxy( $nl_proxy );
291
        ->proxy( C4::Context->preference("NorwegianPatronDBEndpoint") );
293
292
294
    my $from_string;
293
    my $from_string;
295
    if ( $from_arg && $from_arg ne '' ) {
294
    if ( $from_arg && $from_arg ne '' ) {
(-)a/t/NorwegianPatronDB.t (-4 / +7 lines)
Lines 16-22 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Test::More;
19
use Test::More tests => 73;
20
use Test::MockModule;
20
use Test::MockModule;
21
use t::lib::Mocks;
21
use t::lib::Mocks;
22
use Data::Dumper;
22
use Data::Dumper;
Lines 113-122 Relevant sysprefs: Link Here
113
113
114
=cut
114
=cut
115
115
116
BEGIN {
117
    t::lib::Mocks::mock_config('nlkey',        'key');
118
    t::lib::Mocks::mock_config('nlvendoruser', 'user');
119
    t::lib::Mocks::mock_config('nlvendorpass', 'pass');
120
}
116
t::lib::Mocks::mock_preference('NorwegianPatronDBEnable',   0);
121
t::lib::Mocks::mock_preference('NorwegianPatronDBEnable',   0);
117
t::lib::Mocks::mock_preference('NorwegianPatronDBEndpoint', '');
122
t::lib::Mocks::mock_preference('NorwegianPatronDBEndpoint', '');
118
t::lib::Mocks::mock_preference('NorwegianPatronDBUsername', '');
123
t::lib::Mocks::mock_preference('NorwegianPatronDBUsername', '');
119
t::lib::Mocks::mock_preference('NorwegianPatronDBPassword', '');
124
t::lib::Mocks::mock_preference('NorwegianPatronDBPassword', '');
125
120
ok( my $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
126
ok( my $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
121
is( $result->{ 'error' },     1, 'error detected' );
127
is( $result->{ 'error' },     1, 'error detected' );
122
is( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
128
is( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
Lines 298-305 is( $res->{'melding'}, 'ingen treff', 'got "ingen treff"' ); Link Here
298
is( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
304
is( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
299
is( $res->{'antall_treff'}, 0, 'got 0 records' );
305
is( $res->{'antall_treff'}, 0, 'got 0 records' );
300
306
301
done_testing();
302
303
=head1 SAMPLE SOAP XML RESPONSES
307
=head1 SAMPLE SOAP XML RESPONSES
304
308
305
These responses can be gathered by setting "outputxml()" to true on the SOAP
309
These responses can be gathered by setting "outputxml()" to true on the SOAP
306
- 

Return to bug 11401