SMS::Send::Test(3pm)

πŸ“¦
version 1.07 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– SMS::Send::Test πŸ’–

okay so bestie, welcome to SMS::Send::Test β€” the SMS::Send International-Class Testing Driver. it's giving "test double but make it iconic" ✨


🌸 SYNOPSIS 🌸

# 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;

πŸ¦‹ DESCRIPTION πŸ¦‹

so SMS::Send supports two classes of drivers, and you're gonna wanna know the difference, fr fr:

  • an international class named in the format SMS::Send::Foo, which only accepts international numbers in "+1 XXX XXXXX" format
  • regional-context drivers in the format SMS::Send::XX::Foo, which will also accept a non-leading-plus number in the format applicable within that region (in the above case, Australia πŸ‡¦πŸ‡Ί)

SMS::Send::Test is the testing driver for the international class of drivers. and the way that it's literally identical to SMS::Send::AU::Test except for the name? obsessed. 😌

its two roles are, one, to always exist (like, be installed, periodt), and two, to act as a "trap" for messages. messages sent via SMS::Send::Test always succeed πŸ’…, and you can recover those messages after sending them for testing. bestie it's a whole vibe.

⚠️ heads up though: the trap is done on a per-driver-handle basis, and is not shared between multiple driver handles. so no, your handles don't gossip with each other. πŸ™ˆ

✨ METHODS ✨

SMS::Send::Test inherits all the methods of the parent SMS::Send::Driver class, and adds the following. cute, right?

πŸŽ€ messages

the "messages" method retrieves as a list all of the messages in the message trap. that's it, that's the method.

πŸŽ€ clear

the "clear" method clears the message trap. you should do this before each chunk of test code to ensure you are starting from a known state. no cap, always reset before you test, or you'll be debugging ghosts. πŸ’€

returns true as a convenience. 🫢


😭 SUPPORT

bugs should be reported via the CPAN bug tracker at

<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SMS-Send>

for other issues, contact the author. they're the main character here, ngl.


πŸ‘‘ AUTHOR

Adam Kennedy <adamk@cpan.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.


okay bestie that's the whole page, you ate it up πŸ’… this was perl v5.36.0 and it was generated on 2023-08-18 β€” go forth and trap some messages, iykyk πŸ¦‹πŸ’–

πŸ“¦ where this page comes from