09 Nov 2011 02:46:43 UTC
- Distribution: SMS-Send
- Module version: 0.06
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (7)
- Testers (8445 / 1 / 0)
- KwaliteeBus factor: 1
- 87.99% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (34.36KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
SMS::Send::Test - SMS::Send International-Class Testing Driver
# Create a testing sender my $send = SMS::Send->new( 'Test' ); # Clear the message trap $send->clear; # Send a message $send->send_sms( text => 'Hi there', to => '+61 (4) 1234 5678', ); # Get the message from the trap my @messages = $send->messages;
SMS::Send supports two classes of drivers.
An international class named in the format
SMS::Send::Foo, which only accept international numbers in
+1 XXX XXXXXformat, and regional-context drivers in the format
SMS::Send::XX::Foowhich will also accept a non-leading-plus number in the format applicable within that region (in the above case, Australia).
Its two roles are firstly to always exist (be installed) and secondly to act as a "trap" for messages. Messages sent via SMS::Send::Test always succeed, and the messages can be recovered for testing after sending.
Note that the trap is done on a per-driver-handle basis, and is not shared between multiple driver handles.
SMS::Send::Test inherits all the methods of the parent SMS::Send::Driver class, and adds the following.
messagesmethod retrieves as a list all of the messages in the message trap.
clearmethod clears the message trap. This should be done before each chunk of test code to ensure you are starting from a known state.
Returns true as a convenience.
Bugs should be reported via the CPAN bug tracker at
For other issues, contact the author.
Adam Kennedy <firstname.lastname@example.org>
Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.