| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,66 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace Telnyx; |
|
| 4 |
+ |
|
| 5 |
+/** |
|
| 6 |
+ * @internal |
|
| 7 |
+ * @covers \Telnyx\FQDNConnection |
|
| 8 |
+ */ |
|
| 9 |
+final class FQDNConnectionTest extends \Telnyx\TestCase |
|
| 10 |
+{
|
|
| 11 |
+ const TEST_RESOURCE_ID = '123'; |
|
| 12 |
+ |
|
| 13 |
+ public function testIsListable() |
|
| 14 |
+ {
|
|
| 15 |
+ $this->expectsRequest( |
|
| 16 |
+ 'get', |
|
| 17 |
+ '/v2/fqdn_connections' |
|
| 18 |
+ ); |
|
| 19 |
+ $resources = FQDNConnection::all(); |
|
| 20 |
+ $this->assertInstanceOf(\Telnyx\Collection::class, $resources); |
|
| 21 |
+ $this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resources['data'][0]); |
|
| 22 |
+ } |
|
| 23 |
+ |
|
| 24 |
+ public function testIsCreatable() |
|
| 25 |
+ {
|
|
| 26 |
+ $this->expectsRequest( |
|
| 27 |
+ 'post', |
|
| 28 |
+ '/v2/fqdn_connections' |
|
| 29 |
+ ); |
|
| 30 |
+ $resource = FQDNConnection::create(["connection_name" => "Test Connection"]); |
|
| 31 |
+ $this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); |
|
| 32 |
+ } |
|
| 33 |
+ |
|
| 34 |
+ public function testIsDeletable() |
|
| 35 |
+ {
|
|
| 36 |
+ $resource = FQDNConnection::retrieve(self::TEST_RESOURCE_ID); |
|
| 37 |
+ $this->expectsRequest( |
|
| 38 |
+ 'delete', |
|
| 39 |
+ '/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) |
|
| 40 |
+ ); |
|
| 41 |
+ $resource->delete(); |
|
| 42 |
+ $this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); |
|
| 43 |
+ } |
|
| 44 |
+ |
|
| 45 |
+ public function testIsRetrievable() |
|
| 46 |
+ {
|
|
| 47 |
+ $this->expectsRequest( |
|
| 48 |
+ 'get', |
|
| 49 |
+ '/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) |
|
| 50 |
+ ); |
|
| 51 |
+ $resource = FQDNConnection::retrieve(self::TEST_RESOURCE_ID); |
|
| 52 |
+ $this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); |
|
| 53 |
+ } |
|
| 54 |
+ |
|
| 55 |
+ public function testIsUpdatable() |
|
| 56 |
+ {
|
|
| 57 |
+ $this->expectsRequest( |
|
| 58 |
+ 'patch', |
|
| 59 |
+ '/v2/fqdn_connections/' . urlencode(self::TEST_RESOURCE_ID) |
|
| 60 |
+ ); |
|
| 61 |
+ $resource = FQDNConnection::update(self::TEST_RESOURCE_ID, [ |
|
| 62 |
+ "connection_name" => "Central BSD-1" |
|
| 63 |
+ ]); |
|
| 64 |
+ $this->assertInstanceOf(\Telnyx\FQDNConnection::class, $resource); |
|
| 65 |
+ } |
|
| 66 |
+} |