|
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 => 8; |
22 |
use Test::More tests => 9; |
| 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-43
is( $send_sms, undef, 'send_sms without arguments returns undef' );
Link Here
|
| 38 |
($send_sms) = C4::SMS->send_sms( |
38 |
($send_sms) = C4::SMS->send_sms( |
| 39 |
{ |
39 |
{ |
| 40 |
destination => 'my destination', |
40 |
destination => 'my destination', |
|
|
41 |
message_id => 1, |
| 41 |
} |
42 |
} |
| 42 |
); |
43 |
); |
| 43 |
is( $send_sms, undef, 'send_sms without message returns undef' ); |
44 |
is( $send_sms, undef, 'send_sms without message returns undef' ); |
|
Lines 45-58
is( $send_sms, undef, 'send_sms without message returns undef' );
Link Here
|
| 45 |
($send_sms) = C4::SMS->send_sms( |
46 |
($send_sms) = C4::SMS->send_sms( |
| 46 |
{ |
47 |
{ |
| 47 |
message => 'my message', |
48 |
message => 'my message', |
|
|
49 |
message_id => 1, |
| 48 |
} |
50 |
} |
| 49 |
); |
51 |
); |
| 50 |
is( $send_sms, undef, 'send_sms without destination returns undef' ); |
52 |
is( $send_sms, undef, 'send_sms without destination returns undef' ); |
| 51 |
|
53 |
|
|
|
54 |
$send_sms = C4::SMS->send_sms({ |
| 55 |
destination => 'my destination', |
| 56 |
message => 'my message', |
| 57 |
}); |
| 58 |
is( $send_sms, undef, 'send_sms without message_id returns undef' ); |
| 59 |
|
| 52 |
( $send_sms, $error ) = C4::SMS->send_sms( |
60 |
( $send_sms, $error ) = C4::SMS->send_sms( |
| 53 |
{ |
61 |
{ |
| 54 |
destination => 'my destination', |
62 |
destination => 'my destination', |
| 55 |
message => 'my message', |
63 |
message => 'my message', |
|
|
64 |
message_id => 1, |
| 56 |
driver => '', |
65 |
driver => '', |
| 57 |
} |
66 |
} |
| 58 |
); |
67 |
); |
|
Lines 64-69
is( $error, 'SMS_SEND_DRIVER_MISSING', 'Error code returned is SMS_SEND_DRIVE
Link Here
|
| 64 |
destination => '+33123456789', |
73 |
destination => '+33123456789', |
| 65 |
message => 'my message', |
74 |
message => 'my message', |
| 66 |
driver => 'Test', |
75 |
driver => 'Test', |
|
|
76 |
message_id => 1, |
| 67 |
} |
77 |
} |
| 68 |
); |
78 |
); |
| 69 |
is( $send_sms, 1, 'send_sms returns 1' ); |
79 |
is( $send_sms, 1, 'send_sms returns 1' ); |
| 70 |
- |
|
|