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,41 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * @internal
7
+ * @covers \Telnyx\ApiOperations\Retrieve
8
+ */
9
+
10
+class DummyRetrieve extends ApiResource
11
+{
12
+    const OBJECT_NAME = 'phone_number';
13
+
14
+    use \Telnyx\ApiOperations\Retrieve;
15
+}
16
+class DummyRetrieveWithId extends ApiResource
17
+{
18
+    const OBJECT_NAME = 'call';
19
+    const OBJECT_ID = 'call_control_id';
20
+
21
+    use \Telnyx\ApiOperations\Retrieve;
22
+}
23
+
24
+final class RetrieveTest extends \Telnyx\TestCase
25
+{
26
+    const TEST_RESOURCE_ID = '1293384261075731499';
27
+
28
+    public function testTrait()
29
+    {
30
+        $result = DummyRetrieve::retrieve(self::TEST_RESOURCE_ID);
31
+        $this->assertInstanceOf(\Telnyx\TelnyxObject::class, $result);
32
+        $this->assertNotNull($result['id']);
33
+    }
34
+    public function testTraitWithId()
35
+    {
36
+        $result = DummyRetrieveWithId::retrieve(self::TEST_RESOURCE_ID);
37
+        $this->assertInstanceOf(\Telnyx\TelnyxObject::class, $result);
38
+        $this->assertNotNull($result['id']);
39
+        $this->assertNotNull($result['call_control_id']);
40
+    }
41
+}