I wrapped the use of the SMS::Send module in an eval to make failures graceful if it
is not present.
I also fixed an error with the number of tests in the SMS::Send tests.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
use warnings;
use C4::Context;
-use SMS::Send;
use vars qw( $VERSION );
return unless defined $params->{ $required_parameter };
}
+ eval { require SMS::Send; };
+ if ( $@ ) {
+ # we apparently don't have SMS::Send. Return a failure.
+ return;
+ }
+
# This allows the user to override the driver. See SMS::Send::Test
my $driver = exists $params->{'driver'} ? $params->{'driver'} : $self->driver();
return unless $driver;
sub testing_class { 'C4::SMS' };
-sub send_a_message : Test( 2 ) {
+sub send_a_message : Test( 1 ) {
my $self = shift;
my $success = C4::SMS->send_sms( { destination => '+1 212-555-1111',