7 use Test::More tests => 7;
14 my $driver = 'my mock driver';
15 t::lib::Mocks::mock_preference('SMSSendDriver', $driver);
16 is( C4::SMS->driver(), $driver, 'driver returns the SMSSendDriver correctly' );
19 my $send_sms = C4::SMS->send_sms();
20 is( $send_sms, undef, 'send_sms without arguments returns undef' );
22 $send_sms = C4::SMS->send_sms({
23 destination => 'my destination',
25 is( $send_sms, undef, 'send_sms without message returns undef' );
27 $send_sms = C4::SMS->send_sms({
28 message => 'my message',
30 is( $send_sms, undef, 'send_sms without destination returns undef' );
32 $send_sms = C4::SMS->send_sms({
33 destination => 'my destination',
34 message => 'my message',
37 is( $send_sms, undef, 'send_sms with an undef driver returns undef' );
39 $send_sms = C4::SMS->send_sms({
40 destination => '+33123456789',
41 message => 'my message',
44 is( $send_sms, 1, 'send_sms returns 1' );