add test for RequestFactory

This commit is contained in:
2022-07-11 23:30:44 +02:00
parent 67291c19da
commit 81236bcf2c
2 changed files with 144 additions and 2 deletions

View File

@ -48,8 +48,7 @@ class RequestFactory
*/
public function getSmsRequest() : SmsRequestInterface
{
$smsLength = new SmsLength($this->message);
if ($smsLength->getEncoding() === self::GSM_7BIT) {
if ($this->getSmsLength()->getEncoding() === self::GSM_7BIT) {
$message = new SmsTextMessage($this->message);
return new TextRequest($message, $this->client);
}
@ -57,4 +56,12 @@ class RequestFactory
$message = new SmsBinaryMessage($this->message);
return new BinaryRequest($message, $this->client);
}
/**
* @return SmsLength
*/
protected function getSmsLength(): SmsLength
{
return new SmsLength($this->message);
}
}