-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated All.php to remove filter[] params. This was causing certain tests to fail. Added Connection.php Added CredentialConnection.php Added FQDN.php Added FQDNConnection.php Added IP.php Added IPConnection.php Added various tests
- Loading branch information
1 parent
68c9fd9
commit d71262c
Showing
14 changed files
with
479 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class Connection | ||
* | ||
* @package Telnyx | ||
*/ | ||
class Connection extends ApiResource | ||
{ | ||
const OBJECT_NAME = "connection"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Retrieve; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class CredentialConnection | ||
* | ||
* @package Telnyx | ||
*/ | ||
class CredentialConnection extends ApiResource | ||
{ | ||
const OBJECT_NAME = "credential_connection"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class FQDN | ||
* | ||
* @package Telnyx | ||
*/ | ||
class FQDN extends ApiResource | ||
{ | ||
const OBJECT_NAME = "fqdn"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class FQDNConnection | ||
* | ||
* @package Telnyx | ||
*/ | ||
class FQDNConnection extends ApiResource | ||
{ | ||
const OBJECT_NAME = "fqdn_connection"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class IP | ||
* | ||
* @package Telnyx | ||
*/ | ||
class IP extends ApiResource | ||
{ | ||
const OBJECT_NAME = "ip"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class IPConnection | ||
* | ||
* @package Telnyx | ||
*/ | ||
class IPConnection extends ApiResource | ||
{ | ||
const OBJECT_NAME = "ip_connection"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
class ConnectionTest extends TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/connections' | ||
); | ||
$resources = Connection::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $resources); | ||
$this->assertInstanceOf(\Telnyx\Connection::class, $resources[0]); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = Connection::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\Connection::class, $resource); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
class CredentialConnectionTest extends TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/credential_connections' | ||
); | ||
$resources = CredentialConnection::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $resources); | ||
$this->assertInstanceOf(\Telnyx\CredentialConnection::class, $resources[0]); | ||
} | ||
|
||
public function testIsCreatable() | ||
{ | ||
$this->expectsRequest( | ||
'post', | ||
'/v2/credential_connections' | ||
); | ||
$resource = CredentialConnection::create(["connection_name" => "Test Connection"]); | ||
$this->assertInstanceOf(\Telnyx\CredentialConnection::class, $resource); | ||
} | ||
|
||
public function testIsDeletable() | ||
{ | ||
$resource = CredentialConnection::retrieve(self::TEST_RESOURCE_ID); | ||
$this->expectsRequest( | ||
'delete', | ||
'/v2/credential_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource->delete(); | ||
$this->assertInstanceOf(\Telnyx\CredentialConnection::class, $resource); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/credential_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = CredentialConnection::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\CredentialConnection::class, $resource); | ||
} | ||
|
||
public function testIsUpdatable() | ||
{ | ||
$this->expectsRequest( | ||
'patch', | ||
'/v2/credential_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = CredentialConnection::update(self::TEST_RESOURCE_ID, [ | ||
"connection_name" => "Central BSD-1" | ||
]); | ||
$this->assertInstanceOf(\Telnyx\CredentialConnection::class, $resource); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
class FQDNConnectionTest extends TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/fqdn_connections' | ||
); | ||
$resources = FQDNConnection::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $resources); | ||
$this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resources[0]); | ||
} | ||
|
||
public function testIsCreatable() | ||
{ | ||
$this->expectsRequest( | ||
'post', | ||
'/v2/fqdn_connections' | ||
); | ||
$resource = FQDNConnection::create(["connection_name" => "Test Connection"]); | ||
$this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); | ||
} | ||
|
||
public function testIsDeletable() | ||
{ | ||
$resource = FQDNConnection::retrieve(self::TEST_RESOURCE_ID); | ||
$this->expectsRequest( | ||
'delete', | ||
'/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource->delete(); | ||
$this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = FQDNConnection::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); | ||
} | ||
|
||
public function testIsUpdatable() | ||
{ | ||
$this->expectsRequest( | ||
'patch', | ||
'/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = FQDNConnection::update(self::TEST_RESOURCE_ID, [ | ||
"connection_name" => "Central BSD-1" | ||
]); | ||
$this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
class FQDNTest extends TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/fqdns' | ||
); | ||
$resources = FQDN::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $resources); | ||
$this->assertInstanceOf(\Telnyx\FQDN::class, $resources[0]); | ||
} | ||
|
||
public function testIsCreatable() | ||
{ | ||
$this->expectsRequest( | ||
'post', | ||
'/v2/fqdns' | ||
); | ||
$resource = FQDN::create(["fqdn" => "example.com"]); | ||
$this->assertInstanceOf(\Telnyx\FQDN::class, $resource); | ||
} | ||
|
||
public function testIsDeletable() | ||
{ | ||
$resource = FQDN::retrieve(self::TEST_RESOURCE_ID); | ||
$this->expectsRequest( | ||
'delete', | ||
'/v2/fqdns/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource->delete(); | ||
$this->assertInstanceOf(\Telnyx\FQDN::class, $resource); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/fqdns/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = FQDN::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\FQDN::class, $resource); | ||
} | ||
|
||
public function testIsUpdatable() | ||
{ | ||
$this->expectsRequest( | ||
'patch', | ||
'/v2/fqdns/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = FQDN::update(self::TEST_RESOURCE_ID, [ | ||
"fqdn" => "example.com" | ||
]); | ||
$this->assertInstanceOf(\Telnyx\FQDN::class, $resource); | ||
} | ||
|
||
} |
Oops, something went wrong.