mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 06:42:14 +09:00
Minor changes to support unit testing via dummy
This commit is contained in:
parent
a92c77655f
commit
aab6bd6d48
2 changed files with 38 additions and 3 deletions
|
|
@ -32,6 +32,11 @@ class Dummy extends Base implements \Rhymix\Framework\Drivers\SMSInterface
|
|||
'delay_supported' => true,
|
||||
);
|
||||
|
||||
/**
|
||||
* Sent messages are stored here for debugging and testing.
|
||||
*/
|
||||
protected $_sent_messages = array();
|
||||
|
||||
/**
|
||||
* Send a message.
|
||||
*
|
||||
|
|
@ -43,6 +48,30 @@ class Dummy extends Base implements \Rhymix\Framework\Drivers\SMSInterface
|
|||
*/
|
||||
public function send(array $messages, \Rhymix\Framework\SMS $original)
|
||||
{
|
||||
foreach ($messages as $message)
|
||||
{
|
||||
$this->_sent_messages[] = $message;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sent messages.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSentMessages()
|
||||
{
|
||||
return $this->_sent_messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset sent messages.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function resetSentMessages()
|
||||
{
|
||||
$this->_sent_messages = array();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue