Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use t::lib::Mocks; |
20 |
use t::lib::Mocks; |
21 |
|
21 |
|
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
23 |
|
23 |
|
24 |
BEGIN { |
24 |
BEGIN { |
25 |
use_ok('C4::SMS', qw( driver send_sms )); |
25 |
use_ok('C4::SMS', qw( driver send_sms )); |
Lines 38-54
is( $send_sms, undef, 'send_sms without arguments returns undef' );
Link Here
|
38 |
|
38 |
|
39 |
$send_sms = C4::SMS->send_sms({ |
39 |
$send_sms = C4::SMS->send_sms({ |
40 |
destination => 'my destination', |
40 |
destination => 'my destination', |
|
|
41 |
message_id => 1, |
41 |
}); |
42 |
}); |
42 |
is( $send_sms, undef, 'send_sms without message returns undef' ); |
43 |
is( $send_sms, undef, 'send_sms without message returns undef' ); |
43 |
|
44 |
|
44 |
$send_sms = C4::SMS->send_sms({ |
45 |
$send_sms = C4::SMS->send_sms({ |
45 |
message => 'my message', |
46 |
message => 'my message', |
|
|
47 |
message_id => 1, |
46 |
}); |
48 |
}); |
47 |
is( $send_sms, undef, 'send_sms without destination returns undef' ); |
49 |
is( $send_sms, undef, 'send_sms without destination returns undef' ); |
48 |
|
50 |
|
49 |
$send_sms = C4::SMS->send_sms({ |
51 |
$send_sms = C4::SMS->send_sms({ |
50 |
destination => 'my destination', |
52 |
destination => 'my destination', |
51 |
message => 'my message', |
53 |
message => 'my message', |
|
|
54 |
}); |
55 |
is( $send_sms, undef, 'send_sms without message_id returns undef' ); |
56 |
|
57 |
$send_sms = C4::SMS->send_sms({ |
58 |
destination => 'my destination', |
59 |
message => 'my message', |
60 |
message_id => 1, |
52 |
driver => '', |
61 |
driver => '', |
53 |
}); |
62 |
}); |
54 |
is( $send_sms, undef, 'send_sms with an undef driver returns undef' ); |
63 |
is( $send_sms, undef, 'send_sms with an undef driver returns undef' ); |
Lines 57-62
$send_sms = C4::SMS->send_sms({
Link Here
|
57 |
destination => '+33123456789', |
66 |
destination => '+33123456789', |
58 |
message => 'my message', |
67 |
message => 'my message', |
59 |
driver => 'Test', |
68 |
driver => 'Test', |
|
|
69 |
message_id => 1, |
60 |
}); |
70 |
}); |
61 |
is( $send_sms, 1, 'send_sms returns 1' ); |
71 |
is( $send_sms, 1, 'send_sms returns 1' ); |
62 |
|
72 |
|
63 |
- |
|
|