Bug 37810: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
This commit is contained in:
parent
f8fb37b3fa
commit
da96f8cfe5
|
|
@ -118,29 +118,45 @@ subtest 'test_connection() tests' => sub {
|
|||
$schema->storage->txn_begin;
|
||||
|
||||
my $ua = Test::MockModule->new('LWP::UserAgent');
|
||||
$ua->mock('simple_request', sub {
|
||||
$ua->mock(
|
||||
'simple_request',
|
||||
sub {
|
||||
my $response = Test::MockObject->new();
|
||||
|
||||
$response->mock('code', sub {
|
||||
return 200;
|
||||
});
|
||||
$response->mock('is_error', sub {
|
||||
return 0;
|
||||
});
|
||||
$response->mock('is_redirect', sub {
|
||||
return 0;
|
||||
});
|
||||
$response->mock('decoded_content', sub {
|
||||
return '{"Description":"COUNTER Usage Reports for Test platform.","ServiceActive":true,"RegistryURL":"https://www.whatever.com"}';
|
||||
});
|
||||
$response->mock(
|
||||
'code',
|
||||
sub {
|
||||
return 200;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'is_error',
|
||||
sub {
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'is_redirect',
|
||||
sub {
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
$response->mock(
|
||||
'decoded_content',
|
||||
sub {
|
||||
return
|
||||
'{"Description":"COUNTER Usage Reports for Test platform.","ServiceActive":true,"RegistryURL":"https://www.whatever.com"}';
|
||||
}
|
||||
);
|
||||
$response->{_rc} = 200;
|
||||
return $response;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
my $usage_data_provider = $builder->build_object(
|
||||
{ class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } );
|
||||
|
||||
is( $usage_data_provider->test_connection, 1);
|
||||
is( $usage_data_provider->test_connection, 1 );
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue