make deprecated client argument optional in recipients list
This commit is contained in:
parent
54cfb2645c
commit
6c5a83a8a8
@ -31,7 +31,7 @@ abstract class ApiTestCase extends TestCase
|
||||
* @return mixed
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function callMethod(object $object, string $methodName, array $arguments = [])
|
||||
public function callMethod($object, string $methodName, array $arguments = [])
|
||||
{
|
||||
$class = new ReflectionClass($object);
|
||||
$method = $class->getMethod($methodName);
|
||||
@ -47,7 +47,7 @@ abstract class ApiTestCase extends TestCase
|
||||
* @param $value
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function setValue(object $object, string $valueName, $value)
|
||||
public function setValue($object, string $valueName, $value)
|
||||
{
|
||||
$reflection = new ReflectionClass($object);
|
||||
$property = $reflection->getProperty($valueName);
|
||||
@ -63,7 +63,7 @@ abstract class ApiTestCase extends TestCase
|
||||
* @return mixed
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function getValue(object $object, string $valueName)
|
||||
public function getValue($object, string $valueName)
|
||||
{
|
||||
$reflection = new ReflectionClass($object);
|
||||
$property = $reflection->getProperty($valueName);
|
||||
|
@ -15,9 +15,8 @@ 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\Exception\InvalidArgumentException;
|
||||
use Phlib\SmsLength\SmsLength;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use ReflectionException;
|
||||
@ -94,7 +93,7 @@ class SmsBinaryMessageTest extends SmsMessageAbstractTest
|
||||
if ($valid) {
|
||||
$smsLengthMock->expects($this->never())->method('validate')->willReturn(true);
|
||||
} else {
|
||||
$smsLengthMock->expects($this->atLeastOnce())->method('validate')->willThrowException(new \Phlib\SmsLength\Exception\InvalidArgumentException());
|
||||
$smsLengthMock->expects($this->atLeastOnce())->method('validate')->willThrowException(new InvalidArgumentException());
|
||||
}
|
||||
|
||||
/** @var SmsBinaryMessage|MockObject $message */
|
||||
|
@ -19,7 +19,6 @@ use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Tests\ApiTestCase;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsBinaryMessage;
|
||||
use Phlib\SmsLength\SmsLength;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use ReflectionException;
|
||||
|
||||
abstract class SmsMessageAbstractTest extends ApiTestCase
|
||||
|
@ -32,13 +32,15 @@ class RecipientsList implements RecipientsListInterface, Iterator
|
||||
private $recipients = [];
|
||||
|
||||
/**
|
||||
* @deprecated unused client parameter will removed
|
||||
* @param Client $client
|
||||
* @deprecated unused client parameter will remove
|
||||
* @param Client|null $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client = null)
|
||||
{
|
||||
if ($client) {
|
||||
$this->setClient( $client );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Recipient $recipient
|
||||
|
@ -21,7 +21,7 @@ use D3\LinkmobilityClient\ValueObject\Recipient;
|
||||
interface RecipientsListInterface
|
||||
{
|
||||
/**
|
||||
* @deprecated unused client parameter will removed
|
||||
* @deprecated unused client parameter will remove
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client);
|
||||
|
@ -25,7 +25,6 @@ use D3\LinkmobilityClient\ValueObject\Recipient;
|
||||
use D3\LinkmobilityClient\ValueObject\Sender;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsMessageAbstract;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsMessageInterface;
|
||||
use D3\LinkmobilityClient\ValueObject\StringValueObject;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use InvalidArgumentException;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user