From cb230b4f2df615c4d25fd0bdce5e58a77cf54c0c Mon Sep 17 00:00:00 2001 From: weroh <50031971+weroh@users.noreply.github.com> Date: Mon, 16 Mar 2020 16:37:29 -0700 Subject: [PATCH] Tests 2020-03-16 (#25) * Update ApiRequestor.php Fixed params for isset() * Added OutboundVoiceProfile Added OutboundVoiceProfile * Create OutboundVoiceProfileTest.php Create OutboundVoiceProfileTest.php * Updated Tests Updated Tests --- .../AlphanumericSenderIDTest.php | 30 ------------------- .../AvailablePhoneNumberTest.php | 4 +-- tests/api_resources/ConnectionTest.php | 2 +- tests/api_resources/MessagingProfileTest.php | 14 +-------- 4 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 tests/api_resources/AlphanumericSenderIDTest.php diff --git a/tests/api_resources/AlphanumericSenderIDTest.php b/tests/api_resources/AlphanumericSenderIDTest.php deleted file mode 100644 index 242d993..0000000 --- a/tests/api_resources/AlphanumericSenderIDTest.php +++ /dev/null @@ -1,30 +0,0 @@ -expectsRequest( - 'get', - '/v2/alphanumeric_sender_ids' - ); - $resources = AlphanumericSenderID::all(); - $this->assertInstanceOf(\Telnyx\Collection::class, $resources); - $this->assertInstanceOf(\Telnyx\AlphanumericSenderID::class, $resources[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v2/alphanumeric_sender_ids/' . urlencode(self::TEST_RESOURCE_ID) - ); - $resource = AlphanumericSenderID::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf(\Telnyx\AlphanumericSenderID::class, $resource); - } -} diff --git a/tests/api_resources/AvailablePhoneNumberTest.php b/tests/api_resources/AvailablePhoneNumberTest.php index d55ee66..c144ef6 100644 --- a/tests/api_resources/AvailablePhoneNumberTest.php +++ b/tests/api_resources/AvailablePhoneNumberTest.php @@ -14,9 +14,7 @@ public function testIsListable() ); $resources = AvailablePhoneNumber::all([ 'filter' => [ - "limit" => 1, - "features" => ["sms", "mms"], - "phone_number" => ["contains" => "555"], + "phone_number" => ["starts_with" => "555"], ] ]); $this->assertInstanceOf(\Telnyx\Collection::class, $resources); diff --git a/tests/api_resources/ConnectionTest.php b/tests/api_resources/ConnectionTest.php index f6436bb..c977403 100644 --- a/tests/api_resources/ConnectionTest.php +++ b/tests/api_resources/ConnectionTest.php @@ -14,7 +14,7 @@ public function testIsListable() ); $resources = Connection::all(); $this->assertInstanceOf(\Telnyx\Collection::class, $resources); - $this->assertInstanceOf(\Telnyx\Connection::class, $resources[0]); + $this->assertInstanceOf(\Telnyx\IPConnection::class, $resources[0]); } public function testIsRetrievable() diff --git a/tests/api_resources/MessagingProfileTest.php b/tests/api_resources/MessagingProfileTest.php index 61e5e0a..aa17f82 100644 --- a/tests/api_resources/MessagingProfileTest.php +++ b/tests/api_resources/MessagingProfileTest.php @@ -35,7 +35,7 @@ public function testIsCreatable() 'post', '/v2/messaging_profiles' ); - $resource = MessagingProfile::create(["country" => "US", "type" => "custom"]); + $resource = MessagingProfile::create(["name" => "Summer Campaign"]); $this->assertInstanceOf(\Telnyx\MessagingProfile::class, $resource); } @@ -86,16 +86,4 @@ public function testCanCallShortCodes() $this->assertInstanceOf(\Telnyx\ShortCode::class, $resources[0]); } - - public function testCanCallAlphanumericSenderIds() - { - $messaging_profile = MessagingProfile::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v2/messaging_profiles/' . urlencode(self::TEST_RESOURCE_ID) . '/alphanumeric_sender_ids' - ); - $resources = $messaging_profile->alphanumeric_sender_ids(); - $this->assertInstanceOf(\Telnyx\MessagingProfile::class, $resources); - $this->assertInstanceOf(\Telnyx\AlphanumericSenderId::class, $resources[0]); - } }