Skip to content

Commit

Permalink
Add SmsSenderInterface
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
sveneld committed Feb 28, 2024
1 parent b80ff7b commit 1c4f214
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Sms/SmsSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
$this->db = $db;
}

public function send($number,$message)
public function send($number, $message)
{
if (strlen($message) > 160) {
$messageParts = str_split($message, 160);
Expand Down
3 changes: 2 additions & 1 deletion src/SmsConnector/DebugConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ public function checkConfig(array $config)
public function respond()
{
}

public function send($number, $text)
{
echo $number. ' -&gt ' . $text .PHP_EOL;
echo $number . ' -&gt ' . $text . PHP_EOL;
}
}
3 changes: 3 additions & 0 deletions tests/Sms/SmsSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function testSendShort()
$this->smsSender->send($number, $message);
}

/**
* @phpcs:disable Generic.LineLengthSniff
*/
public function testSendBig()
{
$number = '123456789';
Expand Down
2 changes: 1 addition & 1 deletion tests/SmsConnector/DebugConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public function testSend()
{
$debugConnector = new DebugConnector();
$debugConnector->send('123456789', 'Hello, World!');
$this->expectOutputString('123456789 -&gt Hello, World!'.PHP_EOL);
$this->expectOutputString('123456789 -&gt Hello, World!' . PHP_EOL);
}
}

0 comments on commit 1c4f214

Please sign in to comment.