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,37 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * @internal
7
+ * @covers \Telnyx\ApiOperations\Update
8
+ */
9
+
10
+class DummyUpdate extends ApiResource
11
+{
12
+    const OBJECT_NAME = 'phone_number';
13
+
14
+    use \Telnyx\ApiOperations\Update;
15
+}
16
+
17
+final class UpdateTest extends \Telnyx\TestCase
18
+{
19
+    const TEST_RESOURCE_ID = '1293384261075731499';
20
+
21
+    public function testTraitUpdate()
22
+    {
23
+        $result = DummyUpdate::update(self::TEST_RESOURCE_ID, ['customer_reference'=>'MY REF 001']);
24
+        $this->assertInstanceOf(\Telnyx\PhoneNumber::class, $result);
25
+        $this->assertNotNull($result['connection_id']);
26
+        $this->assertNotNull($result['id']);
27
+    }
28
+
29
+    public function testTraitSave()
30
+    {
31
+        $class = new DummyUpdate(self::TEST_RESOURCE_ID);
32
+        $class->customer_reference = 'MY REF 001';
33
+        $result = $class->save();
34
+        $this->assertNotNull($result['connection_id']);
35
+        $this->assertNotNull($result['id']);
36
+    }
37
+}