Browse code

Added README.md appinfo/info.xml appinfo/signature.json lib/Controller/AuthorApiController.php and the providers directory

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