linkmobility-php-client/Tests/ValueObject/SmsMessageAbstractTest.php

66 regels
1.6 KiB
PHP

2022-07-21 14:07:10 +02:00
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\LinkmobilityClient\Tests\ValueObject;
use Assert\InvalidArgumentException;
use D3\LinkmobilityClient\Tests\ApiTestCase;
use D3\LinkmobilityClient\ValueObject\SmsBinaryMessage;
use Phlib\SmsLength\SmsLength;
use ReflectionException;
abstract class SmsMessageAbstractTest extends ApiTestCase
{
public $message;
/**
* @return void
*/
public function tearDown(): void
{
parent::tearDown();
unset($this->message);
}
/**
* @return array[]
*/
public function constructInvalidDataProvider(): array
{
return [
'empty message' => ['', true, InvalidArgumentException::class],
'invalid sms message' => ['abc', false, \Phlib\SmsLength\Exception\InvalidArgumentException::class],
];
}
/**
* @test
* @throws ReflectionException
* @covers \D3\LinkmobilityClient\ValueObject\SmsBinaryMessage::getSmsLength
* @covers \D3\LinkmobilityClient\ValueObject\SmsTextMessage::getSmsLength
*/
public function testGetSmsLengthInstance()
{
$this->assertInstanceOf(
SmsLength::class,
$this->callMethod(
$this->message,
'getSmsLength'
)
);
}
}