Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:35:09
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
1
+<?php
2
+
3
+namespace Plivo\Tests\Resources;
4
+
5
+
6
+
7
+
8
+use Plivo\Http\PlivoRequest;
9
+use Plivo\Http\PlivoResponse;
10
+use Plivo\Tests\BaseTestCase;
11
+
12
+
13
+/**
14
+ * Class ProfileTest
15
+ * @package Plivo\Tests\Resources
16
+ */
17
+class ProfileTest extends BaseTestCase {
18
+
19
+    function testProfileGet()
20
+    {
21
+        $request = new PlivoRequest(
22
+            'GET',
23
+            'Account/MAXXXXXXXXXXXXXXXXXX/Profile/06ecae31-4bf8-40b9-ac62-e902418e9935/', []);
24
+        $body = file_get_contents(__DIR__ . '/../Mocks/profileGetResponse.json');
25
+
26
+        $this->mock(new PlivoResponse($request,200, $body));
27
+
28
+        $actual = $this->client->profile->get('06ecae31-4bf8-40b9-ac62-e902418e9935');
29
+
30
+        $this->assertRequest($request);
31
+
32
+        self::assertNotNull($actual);
33
+    }
34
+
35
+    function testProfileList()
36
+    {
37
+        $request = new PlivoRequest(
38
+            'Get',
39
+            'Account/MAXXXXXXXXXXXXXXXXXX/Profile/',
40
+            []);
41
+        $body = file_get_contents(__DIR__ . '/../Mocks/profileListResponse.json');
42
+        
43
+        $this->mock(new PlivoResponse($request,202, $body));
44
+        
45
+        $actual = $this->client->profile->list();
46
+        
47
+        $this->assertRequest($request);
48
+        
49
+        self::assertNotNull($actual);
50
+    }
51
+
52
+    function testProfileDelete()
53
+    {
54
+        $request = new PlivoRequest(
55
+            'DELETE',
56
+            'Account/MAXXXXXXXXXXXXXXXXXX/Profile/06ecae31-4bf8-40b9-ac62-e902418e9935/', []);
57
+        $body = file_get_contents(__DIR__ . '/../Mocks/profileDeleteResponse.json');
58
+
59
+        $this->mock(new PlivoResponse($request,200, $body));
60
+
61
+        $actual = $this->client->profile->delete('06ecae31-4bf8-40b9-ac62-e902418e9935');
62
+
63
+        $this->assertRequest($request);
64
+
65
+        self::assertNotNull($actual);
66
+    }
67
+}
0 68
\ No newline at end of file