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,61 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * @internal
7
+ * @covers \Telnyx\Fax
8
+ */
9
+final class FaxTest extends \Telnyx\TestCase
10
+{
11
+    const TEST_RESOURCE_ID = '123';
12
+
13
+    public function testIsListable()
14
+    {
15
+        $this->expectsRequest(
16
+            'get',
17
+            '/v2/faxes'
18
+        );
19
+        $resources = Fax::all();
20
+        $this->assertInstanceOf(\Telnyx\Collection::class, $resources);
21
+        $this->assertInstanceOf(\Telnyx\Fax::class, $resources['data'][0]);
22
+    }
23
+
24
+    public function testIsCreatable()
25
+    {
26
+        $this->expectsRequest(
27
+            'post',
28
+            '/v2/faxes'
29
+        );
30
+        $resource = Fax::create([
31
+            "connection_id" => "234423",
32
+            "media_url" => "http://assets.com/FAX.pdf",
33
+            "to" => "+13127367276",
34
+            "from" => "+13125790015"
35
+        ]);
36
+        $this->assertInstanceOf(\Telnyx\Fax::class, $resource);
37
+    }
38
+
39
+    /*
40
+    public function testIsDeletable()
41
+    {
42
+        $resource = Fax::retrieve(self::TEST_RESOURCE_ID);
43
+        $this->expectsRequest(
44
+            'delete',
45
+            '/v2/faxes/' . urlencode(self::TEST_RESOURCE_ID)
46
+        );
47
+        $resource->delete();
48
+        $this->assertInstanceOf(\Telnyx\Fax::class, $resource);
49
+    }
50
+    */
51
+
52
+    public function testIsRetrievable()
53
+    {
54
+        $this->expectsRequest(
55
+            'get',
56
+            '/v2/faxes/' . urlencode(self::TEST_RESOURCE_ID)
57
+        );
58
+        $resource = Fax::retrieve(self::TEST_RESOURCE_ID);
59
+        $this->assertInstanceOf(\Telnyx\Fax::class, $resource);
60
+    }
61
+}