diff --git a/.gitignore b/.gitignore index c3d69fbb..b8cad2b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ vendor/ -composer.lock +composer*.lock composer.phar .DS_Store .idea/ diff --git a/.travis.yml b/.travis.yml index de597358..938b50c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ language: php dist: xenial php: + - 7.0 + - 7.1 + - 7.2 - 7.3 - 7.4 before_script: + - if [[ ${TRAVIS_PHP_VERSION} == 7.0 ]]; then export COMPOSER=composer-7-0.json; fi - composer install -script: phpunit --verbose +script: php ./vendor/bin/phpunit --verbose diff --git a/README.md b/README.md index 57fbf0f4..770df09c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Requirements - [Sign up](https://www.messagebird.com/en/signup) for a free MessageBird account - Create a new access_key in the developers sections -- MessageBird API client for PHP requires PHP >= 5.4. +- MessageBird API client for PHP requires PHP >= 7.0. Installation ----- diff --git a/composer-7-0.json b/composer-7-0.json new file mode 100644 index 00000000..c5883c74 --- /dev/null +++ b/composer-7-0.json @@ -0,0 +1,25 @@ +{ + "name": "messagebird/php-rest-api", + "description": "MessageBird REST API client for PHP", + "type": "library", + "homepage": "https://github.com/messagebird/php-rest-api", + "license": "BSD-2-Clause", + "authors": [ + { + "name": "MessageBird", + "email": "info@messagebird.com" + } + ], + "require": { + "php": ">=7.0", + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "autoload": { + "psr-4": { + "MessageBird\\": "src/MessageBird/" + } + } +} diff --git a/composer.json b/composer.json index 40a17863..399ce791 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ } ], "require": { - "php": ">=7.2.0", + "php": ">=7.0", "ext-curl": "*" }, "require-dev": { - "phpunit/phpunit": "^8" + "phpunit/phpunit": "^7.5" }, "autoload": { "psr-4": { diff --git a/examples/available-phone-numbers-view.php b/examples/available-phone-numbers-view.php new file mode 100644 index 00000000..40861d14 --- /dev/null +++ b/examples/available-phone-numbers-view.php @@ -0,0 +1,20 @@ +availablePhoneNumbers->getList("nl", array()); + var_dump($phoneNumbers); + +} catch (\MessageBird\Exceptions\AuthenticateException $e) { + var_dump($e->getMessage()); + // That means that your accessKey is unknown + print("wrong login\n"); + +} catch (\Exception $e) { + var_dump($e->getMessage()); + +} +?> diff --git a/examples/phone-numbers-create.php b/examples/phone-numbers-create.php new file mode 100644 index 00000000..db43c3f4 --- /dev/null +++ b/examples/phone-numbers-create.php @@ -0,0 +1,20 @@ +number = '31612345678'; +$NumberPurchaseRequest->countryCode = 'NL'; +$NumberPurchaseRequest->billingIntervalMonths = 1; + +try { + $NumberPurchaseRequestResult = $MessageBird->phoneNumbers->create($NumberPurchaseRequest); + var_dump($NumberPurchaseRequestResult); +} catch (\MessageBird\Exceptions\AuthenticateException $e) { + // That means that your accessKey is unknown + print("wrong login\n"); + +} catch (\Exception $e) { + echo $e->getMessage(); +} diff --git a/examples/phone-numbers-delete.php b/examples/phone-numbers-delete.php new file mode 100644 index 00000000..77bde1c3 --- /dev/null +++ b/examples/phone-numbers-delete.php @@ -0,0 +1,16 @@ +phoneNumbers->delete('31612345678'); + var_dump('Deleted: ' . $deleted); +} catch (\MessageBird\Exceptions\AuthenticateException $e) { + // That means that your accessKey is unknown + print("wrong login\n"); + +} catch (\Exception $e) { + echo $e->getMessage(); +} diff --git a/examples/phone-numbers-update.php b/examples/phone-numbers-update.php new file mode 100644 index 00000000..f0af638f --- /dev/null +++ b/examples/phone-numbers-update.php @@ -0,0 +1,18 @@ +tags = array('tag1'); + +try { + $NumberResult = $MessageBird->phoneNumbers->update($Number, '31612345678'); + var_dump($NumberResult); +} catch (\MessageBird\Exceptions\AuthenticateException $e) { + // That means that your accessKey is unknown + print("wrong login\n"); + +} catch (\Exception $e) { + echo $e->getMessage(); +} diff --git a/examples/phone-numbers-view.php b/examples/phone-numbers-view.php new file mode 100644 index 00000000..a4b4bd8d --- /dev/null +++ b/examples/phone-numbers-view.php @@ -0,0 +1,19 @@ +phoneNumbers->getList(); + var_dump($phoneNumbers); + +} catch (\MessageBird\Exceptions\AuthenticateException $e) { + // That means that your accessKey is unknown + print("wrong login\n"); + +} catch (\Exception $e) { + var_dump($e->getMessage()); + +} +?> diff --git a/src/MessageBird/Client.php b/src/MessageBird/Client.php index ff6287e8..9d06dda2 100644 --- a/src/MessageBird/Client.php +++ b/src/MessageBird/Client.php @@ -14,6 +14,7 @@ class Client const CONVERSATIONSAPI_ENDPOINT = 'https://conversations.messagebird.com/v1'; const VOICEAPI_ENDPOINT = 'https://voice.messagebird.com'; const PARTNER_ACCOUNT_ENDPOINT = 'https://partner-accounts.messagebird.com'; + const NUMBERSAPI_ENDPOINT = 'https://numbers.messagebird.com/v1'; const ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX = 'ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX'; const CONVERSATIONSAPI_WHATSAPP_SANDBOX_ENDPOINT = 'https://whatsapp-sandbox.messagebird.com/v1'; @@ -65,6 +66,11 @@ class Client */ public $lookup; + /** + * @var Resources\AvailableNumbers + */ + public $availableNumbers; + /** * @var Resources\LookupHlr */ @@ -120,6 +126,16 @@ class Client */ public $voiceTranscriptions; + /** + * @var Resources\PhoneNumbers + */ + public $phoneNumbers; + + /** + * @var Resources\AvailablePhoneNumbers + */ + public $availablePhoneNumbers; + /** * @var Resources\Voice\Webhooks */ @@ -184,12 +200,14 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n 'X-MessageBird-Version' => '20170314', )); $this->partnerAccountClient = new Common\HttpClient(self::PARTNER_ACCOUNT_ENDPOINT); + $this->numbersAPIClient = new Common\HttpClient(self::NUMBERSAPI_ENDPOINT); } else { $this->ChatAPIHttpClient = $httpClient; $this->ConversationsAPIHttpClient = $httpClient; $this->HttpClient = $httpClient; $this->VoiceAPIHttpClient = $httpClient; $this->partnerAccountClient = $httpClient; + $this->numbersAPIClient = $httpClient; } $this->HttpClient->addUserAgentString('MessageBird/ApiClient/' . self::CLIENT_VERSION); @@ -207,34 +225,39 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n $this->partnerAccountClient->addUserAgentString('MessageBird/ApiClient/' . self::CLIENT_VERSION); $this->partnerAccountClient->addUserAgentString($this->getPhpVersion()); + $this->numbersAPIClient->addUserAgentString('MessageBird/ApiClient/' . self::CLIENT_VERSION); + $this->numbersAPIClient->addUserAgentString($this->getPhpVersion()); + if ($accessKey !== null) { $this->setAccessKey($accessKey); } - $this->messages = new Resources\Messages($this->HttpClient); - $this->hlr = new Resources\Hlr($this->HttpClient); - $this->verify = new Resources\Verify($this->HttpClient); - $this->balance = new Resources\Balance($this->HttpClient); - $this->voicemessages = new Resources\VoiceMessage($this->HttpClient); - $this->lookup = new Resources\Lookup($this->HttpClient); - $this->lookupHlr = new Resources\LookupHlr($this->HttpClient); - $this->chatMessages = new Resources\Chat\Message($this->ChatAPIHttpClient); - $this->chatChannels = new Resources\Chat\Channel($this->ChatAPIHttpClient); - $this->chatPlatforms = new Resources\Chat\Platform($this->ChatAPIHttpClient); - $this->chatContacts = new Resources\Chat\Contact($this->ChatAPIHttpClient); - $this->voiceCallFlows = new Resources\Voice\CallFlows($this->VoiceAPIHttpClient); - $this->voiceCalls = new Resources\Voice\Calls($this->VoiceAPIHttpClient); - $this->voiceLegs = new Resources\Voice\Legs($this->VoiceAPIHttpClient); - $this->voiceRecordings = new Resources\Voice\Recordings($this->VoiceAPIHttpClient); - $this->voiceTranscriptions = new Resources\Voice\Transcriptions($this->VoiceAPIHttpClient); - $this->voiceWebhooks = new Resources\Voice\Webhooks($this->VoiceAPIHttpClient); - $this->mmsMessages = new Resources\MmsMessages($this->HttpClient); - $this->contacts = new Resources\Contacts($this->HttpClient); - $this->groups = new Resources\Groups($this->HttpClient); - $this->conversations = new Resources\Conversation\Conversations($this->ConversationsAPIHttpClient); + $this->messages = new Resources\Messages($this->HttpClient); + $this->hlr = new Resources\Hlr($this->HttpClient); + $this->verify = new Resources\Verify($this->HttpClient); + $this->balance = new Resources\Balance($this->HttpClient); + $this->voicemessages = new Resources\VoiceMessage($this->HttpClient); + $this->lookup = new Resources\Lookup($this->HttpClient); + $this->lookupHlr = new Resources\LookupHlr($this->HttpClient); + $this->chatMessages = new Resources\Chat\Message($this->ChatAPIHttpClient); + $this->chatChannels = new Resources\Chat\Channel($this->ChatAPIHttpClient); + $this->chatPlatforms = new Resources\Chat\Platform($this->ChatAPIHttpClient); + $this->chatContacts = new Resources\Chat\Contact($this->ChatAPIHttpClient); + $this->voiceCallFlows = new Resources\Voice\CallFlows($this->VoiceAPIHttpClient); + $this->voiceCalls = new Resources\Voice\Calls($this->VoiceAPIHttpClient); + $this->voiceLegs = new Resources\Voice\Legs($this->VoiceAPIHttpClient); + $this->voiceRecordings = new Resources\Voice\Recordings($this->VoiceAPIHttpClient); + $this->voiceTranscriptions = new Resources\Voice\Transcriptions($this->VoiceAPIHttpClient); + $this->voiceWebhooks = new Resources\Voice\Webhooks($this->VoiceAPIHttpClient); + $this->mmsMessages = new Resources\MmsMessages($this->HttpClient); + $this->contacts = new Resources\Contacts($this->HttpClient); + $this->groups = new Resources\Groups($this->HttpClient); + $this->conversations = new Resources\Conversation\Conversations($this->ConversationsAPIHttpClient); $this->conversationMessages = new Resources\Conversation\Messages($this->ConversationsAPIHttpClient); $this->conversationWebhooks = new Resources\Conversation\Webhooks($this->ConversationsAPIHttpClient); - $this->partnerAccounts = new Resources\PartnerAccount\Accounts($this->partnerAccountClient); + $this->partnerAccounts = new Resources\PartnerAccount\Accounts($this->partnerAccountClient); + $this->phoneNumbers = new Resources\PhoneNumbers($this->numbersAPIClient); + $this->availablePhoneNumbers = new Resources\AvailablePhoneNumbers($this->numbersAPIClient); } /** @@ -249,6 +272,7 @@ public function setAccessKey ($accessKey) $this->HttpClient->setAuthentication($Authentication); $this->VoiceAPIHttpClient->setAuthentication($Authentication); $this->partnerAccountClient->setAuthentication($Authentication); + $this->numbersAPIClient->setAuthentication($Authentication); } /** diff --git a/src/MessageBird/Objects/Number.php b/src/MessageBird/Objects/Number.php new file mode 100644 index 00000000..2156d497 --- /dev/null +++ b/src/MessageBird/Objects/Number.php @@ -0,0 +1,62 @@ +HttpClient = $HttpClient; + } + + /** + * @param string $countryCode + * @param array $parameters + * + * @return Objects\BaseList + * @throws \MessageBird\Exceptions\RequestException + * @throws \MessageBird\Exceptions\ServerException + */ + public function getList($countryCode, $parameters = []): Objects\BaseList + { + list($status, , $body) = $this->HttpClient->performHttpRequest( + Common\HttpClient::REQUEST_GET, + "available-phone-numbers/$countryCode", + $parameters + ); + + if ($status !== 200) { + return $this->processRequest($body); + } + $body = json_decode($body); + + $items = $body->data; + unset($body->data); + + $baseList = new Objects\BaseList(); + $baseList->loadFromArray($body); + + foreach ($items as $item) { + $object = new Objects\Number($this->HttpClient); + + $itemObject = $object->loadFromArray($item); + $baseList->items[] = $itemObject; + } + return $baseList; + } + + /** + * @param string $body + * + * @return Objects\Number + * @throws \MessageBird\Exceptions\RequestException + * @throws \MessageBird\Exceptions\ServerException + */ + private function processRequest($body): Objects\Number + { + $body = json_decode($body); + + if (json_last_error()) { + throw new \MessageBird\Exceptions\ServerException('Got an invalid JSON response from the server.'); + } + + if (!empty($body->errors)) { + $ResponseError = new Common\ResponseError($body); + throw new \MessageBird\Exceptions\RequestException($ResponseError->getErrorString()); + } + + return Objects\Number.loadFromArray($body->data[0]); + } +} +?> diff --git a/src/MessageBird/Resources/PhoneNumbers.php b/src/MessageBird/Resources/PhoneNumbers.php new file mode 100644 index 00000000..3ae2d60c --- /dev/null +++ b/src/MessageBird/Resources/PhoneNumbers.php @@ -0,0 +1,57 @@ +HttpClient = $HttpClient; + $this->setObject(new Objects\Number()); + $this->setResourceName('phone-numbers'); + } + + /** + * @param $object + * @param $id + * + * @return Objects\Number + * + * @internal param array $parameters + */ + public function update($object, $id): Objects\Number + { + $objVars = get_object_vars($object); + $body = []; + foreach ($objVars as $key => $value) { + if (null !== $value) { + $body[$key] = $value; + } + } + + $ResourceName = $this->resourceName . ($id ? '/' . $id : null); + $body = json_encode($body); + + // This override is only needed to use the PATCH http method + list(, , $body) = $this->HttpClient->performHttpRequest(Common\HttpClient::REQUEST_PATCH, $ResourceName, false, $body); + return $this->processRequest($body); + } +} +?> diff --git a/test-bash.sh b/test-bash.sh new file mode 100755 index 00000000..cf95c944 --- /dev/null +++ b/test-bash.sh @@ -0,0 +1,5 @@ +#!/bin/bash +TRAVIS_PHP_VERSION=7.5 +V=`echo -e "$TRAVIS_PHP_VERSION\n7.0" | sort -Vr | head -n1` +echo $V +if [ `echo -e "$TRAVIS_PHP_VERSION\n7.0" | sort -Vr | head -n1` == 7.0 ]; then echo "yo"; fi diff --git a/tests/integration/BaseTest.php b/tests/integration/BaseTest.php index 4ea04a8b..4e51cfce 100644 --- a/tests/integration/BaseTest.php +++ b/tests/integration/BaseTest.php @@ -10,7 +10,7 @@ class BaseTest extends TestCase /** @var PHPUnit_Framework_MockObject_MockObject */ protected $mockClient; - protected function setUp(): void + protected function setUp() { $this->mockClient = $this->getMockBuilder("\MessageBird\Common\HttpClient")->setConstructorArgs(array("fake.messagebird.dev"))->getMock(); $this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/balance/BalanceTest.php b/tests/integration/balance/BalanceTest.php index bde69ed8..7ab836a2 100644 --- a/tests/integration/balance/BalanceTest.php +++ b/tests/integration/balance/BalanceTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/chat/ChatTest.php b/tests/integration/chat/ChatTest.php index bc9c79e3..219350e5 100644 --- a/tests/integration/chat/ChatTest.php +++ b/tests/integration/chat/ChatTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/contacts/ContactTest.php b/tests/integration/contacts/ContactTest.php index ae511e51..f3adde86 100644 --- a/tests/integration/contacts/ContactTest.php +++ b/tests/integration/contacts/ContactTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/conversation/ConversationMessageTest.php b/tests/integration/conversation/ConversationMessageTest.php index c6d9e468..87111a53 100644 --- a/tests/integration/conversation/ConversationMessageTest.php +++ b/tests/integration/conversation/ConversationMessageTest.php @@ -46,7 +46,7 @@ class ConversationMessageTest extends BaseTest "type": "video" }'; - protected function setUp(): void + protected function setUp() { parent::setUp(); diff --git a/tests/integration/conversation/ConversationTest.php b/tests/integration/conversation/ConversationTest.php index 15a6daee..94938dd8 100644 --- a/tests/integration/conversation/ConversationTest.php +++ b/tests/integration/conversation/ConversationTest.php @@ -94,7 +94,7 @@ class ConversationTest extends BaseTest "lastUsedChannelId": "channel-id" }'; - protected function setUp(): void + protected function setUp() { parent::setUp(); diff --git a/tests/integration/conversation/ConversationWebhookTest.php b/tests/integration/conversation/ConversationWebhookTest.php index acf236fe..3cae2ec5 100644 --- a/tests/integration/conversation/ConversationWebhookTest.php +++ b/tests/integration/conversation/ConversationWebhookTest.php @@ -37,7 +37,7 @@ class ConversationWebhookTest extends BaseTest "updatedDatetime": "2018-07-20T12:13:51+00:00" }'; - protected function setUp(): void + protected function setUp() { parent::setUp(); diff --git a/tests/integration/groups/GroupTest.php b/tests/integration/groups/GroupTest.php index 4ab0e8d5..42a28beb 100644 --- a/tests/integration/groups/GroupTest.php +++ b/tests/integration/groups/GroupTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/hlr/HlrTest.php b/tests/integration/hlr/HlrTest.php index 34f9d9bd..1eebad69 100644 --- a/tests/integration/hlr/HlrTest.php +++ b/tests/integration/hlr/HlrTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/lookup/LookupTest.php b/tests/integration/lookup/LookupTest.php index a8906d93..0533d1ee 100644 --- a/tests/integration/lookup/LookupTest.php +++ b/tests/integration/lookup/LookupTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/messages/MessagesTest.php b/tests/integration/messages/MessagesTest.php index c558b521..9e246bf1 100644 --- a/tests/integration/messages/MessagesTest.php +++ b/tests/integration/messages/MessagesTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/numbers/AvailablePhoneNumbersTest.php b/tests/integration/numbers/AvailablePhoneNumbersTest.php new file mode 100644 index 00000000..9f64dc0d --- /dev/null +++ b/tests/integration/numbers/AvailablePhoneNumbersTest.php @@ -0,0 +1,16 @@ +client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); + } + + public function testListAvailablePhoneNumbers() + { + $this->expectException(\MessageBird\Exceptions\ServerException::class); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'available-phone-numbers/nl', array (), null); + $this->client->availablePhoneNumbers->getList("nl", array()); + } +} diff --git a/tests/integration/numbers/PhoneNumbersTest.php b/tests/integration/numbers/PhoneNumbersTest.php new file mode 100644 index 00000000..da95cdd1 --- /dev/null +++ b/tests/integration/numbers/PhoneNumbersTest.php @@ -0,0 +1,54 @@ +client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); + } + + public function testReadPhoneNumber() + { + $this->expectException(\MessageBird\Exceptions\ServerException::class); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'phone-numbers/31612345678', null, null); + $this->client->phoneNumbers->read(31612345678); + } + + public function testListPhoneNumbers() + { + $this->expectException(\MessageBird\Exceptions\ServerException::class); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'phone-numbers', array (), null); + $this->client->phoneNumbers->getList(); + } + + public function testUpdatePhoneNumber() + { + $Number = new \MessageBird\Objects\Number(); + $Number->tags = array('tag1'); + + $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn(array(200, '', '{"tags":["tag1"]}')); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('PATCH', 'phone-numbers/31612345678', null, '{"tags":["tag1"]}'); + $this->client->phoneNumbers->update($Number, '31612345678'); + } + + public function testPurchasePhoneNumber() + { + $NumberPurchaseRequest = new \MessageBird\Objects\NumberPurchaseRequest(); + $NumberPurchaseRequest->number = '31612345678'; + $NumberPurchaseRequest->countryCode = 'NL'; + $NumberPurchaseRequest->billingIntervalMonths = 1; + + $NumberJSON = '{"number":"31612345678","countryCode":"NL","billingIntervalMonths":1}'; + + $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn(array(201, '', "[$NumberJSON]")); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('POST', 'phone-numbers', null, $NumberJSON); + $this->client->phoneNumbers->create($NumberPurchaseRequest); + } + + public function testCancelPhoneNumber() + { + $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn(array(204, '', '')); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('DELETE', 'phone-numbers/31612345678', null, null); + $this->client->phoneNumbers->delete('31612345678'); + } +} diff --git a/tests/integration/partneraccount/AccountTest.php b/tests/integration/partneraccount/AccountTest.php index 68206f9d..25391217 100644 --- a/tests/integration/partneraccount/AccountTest.php +++ b/tests/integration/partneraccount/AccountTest.php @@ -2,7 +2,7 @@ class AccountTest extends BaseTest { - protected function setUp(): void + protected function setUp() { parent::setUp(); $this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/verify/VerifyTest.php b/tests/integration/verify/VerifyTest.php index 589e864d..c796a968 100644 --- a/tests/integration/verify/VerifyTest.php +++ b/tests/integration/verify/VerifyTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/voice/VoiceTest.php b/tests/integration/voice/VoiceTest.php index 0d7cd7c2..fd51031f 100644 --- a/tests/integration/voice/VoiceTest.php +++ b/tests/integration/voice/VoiceTest.php @@ -5,7 +5,7 @@ class VoiceTest extends BaseTest /** @var \MessageBird\Client client */ public $client; - protected function setUp(): void + protected function setUp() { parent::setUp(); $this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient); diff --git a/tests/integration/voicemessages/VoiceMessagesTest.php b/tests/integration/voicemessages/VoiceMessagesTest.php index 6ea883a2..726e336a 100644 --- a/tests/integration/voicemessages/VoiceMessagesTest.php +++ b/tests/integration/voicemessages/VoiceMessagesTest.php @@ -1,7 +1,7 @@ client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);