Lines 22-27
use Encode;
Link Here
|
22 |
use Test::More tests => 6; |
22 |
use Test::More tests => 6; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
|
|
25 |
use Test::Warn; |
25 |
|
26 |
|
26 |
use Koha::Database; |
27 |
use Koha::Database; |
27 |
use Koha::BackgroundJobs; |
28 |
use Koha::BackgroundJobs; |
Lines 303-318
subtest 'decoded_data() and set_encoded_data() tests' => sub {
Link Here
|
303 |
}; |
304 |
}; |
304 |
|
305 |
|
305 |
subtest 'decoded_data() and set_encoded_data() tests' => sub { |
306 |
subtest 'decoded_data() and set_encoded_data() tests' => sub { |
306 |
plan tests => 2; |
307 |
plan tests => 3; |
307 |
|
308 |
|
308 |
$ENV{KOHA_STOMP_HOSTNAME} = "not_localhost"; |
309 |
t::lib::Mocks::mock_config( 'message_broker', { hostname => 'not_localhost', port => '99999' } ); |
309 |
$ENV{KOHA_STOMP_PORT} = "99999"; |
|
|
310 |
|
310 |
|
311 |
t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'STOMP' ); |
311 |
t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'STOMP' ); |
312 |
my $job = Koha::BackgroundJob->connect(); |
312 |
my $job; |
|
|
313 |
warning_like { $job = Koha::BackgroundJob->connect() } qr{Cannot connect to broker}; |
313 |
is( $job, undef, "Return undef if unable to connect when using stomp" ); |
314 |
is( $job, undef, "Return undef if unable to connect when using stomp" ); |
314 |
|
315 |
|
315 |
t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'polling' ); |
316 |
t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'polling' ); |
316 |
$job = Koha::BackgroundJob->connect(); |
317 |
$job = Koha::BackgroundJob->connect(); |
317 |
is( $job, undef, "Return undef if using polling" ); |
318 |
is( $job, undef, "Return undef if using polling" ); |
318 |
} |
319 |
}; |
319 |
- |
|
|