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,29 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+class ShortCodeTest extends TestCase
6
+{
7
+    const TEST_RESOURCE_ID = '123';
8
+
9
+    public function testIsListable()
10
+    {
11
+        $this->expectsRequest(
12
+            'get',
13
+            '/v2/short_codes'
14
+        );
15
+        $resources = ShortCode::all();
16
+        $this->assertInstanceOf(\Telnyx\Collection::class, $resources);
17
+        $this->assertInstanceOf(\Telnyx\ShortCode::class, $resources[0]);
18
+    }
19
+
20
+    public function testIsRetrievable()
21
+    {
22
+        $this->expectsRequest(
23
+            'get',
24
+            '/v2/short_codes/' . urlencode(self::TEST_RESOURCE_ID)
25
+        );
26
+        $resource = ShortCode::retrieve(self::TEST_RESOURCE_ID);
27
+        $this->assertInstanceOf(\Telnyx\ShortCode::class, $resource);
28
+    }
29
+}