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,57 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * @internal
7
+ * @covers \Telnyx\NumberReservation
8
+ */
9
+final class NumberReservationTest extends \Telnyx\TestCase
10
+{
11
+    const NUMBER_RESERVATION_ID = "f7964e2b-a9f9-4eb6-ab16-e570ffc4bc83";
12
+
13
+    public function testIsListable()
14
+    {
15
+        $this->expectsRequest(
16
+            'get',
17
+            '/v2/number_reservations'
18
+        );
19
+        $resources = NumberReservation::all();
20
+        $this->assertInstanceOf(\Telnyx\Collection::class, $resources);
21
+        $this->assertInstanceOf(\Telnyx\NumberReservation::class, $resources['data'][0]);
22
+    }
23
+
24
+    public function testIsCreatable()
25
+    {
26
+        $this->expectsRequest(
27
+            'post',
28
+            '/v2/number_reservations'
29
+        );
30
+        $resource = \Telnyx\NumberReservation::create([
31
+            "phone_number" => "+18665552368"
32
+        ]);
33
+        $this->assertInstanceOf(\Telnyx\NumberReservation::class, $resource);
34
+    }
35
+
36
+    public function testIsRetrievable()
37
+    {
38
+        $this->expectsRequest(
39
+            'get',
40
+            '/v2/number_reservations/' . urlencode(self::NUMBER_RESERVATION_ID)
41
+        );
42
+        $resource = \Telnyx\NumberReservation::retrieve(self::NUMBER_RESERVATION_ID);
43
+        $this->assertInstanceOf(\Telnyx\NumberReservation::class, $resource);
44
+    }
45
+
46
+    public function testActionsExtend()
47
+    {
48
+        $number_reservation = \Telnyx\NumberReservation::retrieve(self::NUMBER_RESERVATION_ID);
49
+        $this->expectsRequest(
50
+            'post',
51
+            '/v2/number_reservations/' . urlencode(self::NUMBER_RESERVATION_ID) . '/actions/extend'
52
+        );
53
+        $resource = $number_reservation->actions_extend();
54
+        $this->assertInstanceOf(\Telnyx\NumberReservation::class, $resource);
55
+    }
56
+
57
+}