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,101 @@
1
+<?php
2
+
3
+namespace Resources;
4
+
5
+
6
+use Plivo\Http\PlivoRequest;
7
+use Plivo\Http\PlivoResponse;
8
+use Plivo\Tests\BaseTestCase;
9
+
10
+/**
11
+ * Class ApplicationTest
12
+ * @package Resources
13
+ */
14
+class ApplicationTest extends BaseTestCase
15
+{
16
+    function testApplicationCreate()
17
+    {
18
+        $request = new PlivoRequest(
19
+            'POST',
20
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
21
+            [
22
+                'app_name' => 'app'
23
+            ]);
24
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationCreateResponse.json');
25
+
26
+        $this->mock(new PlivoResponse($request,201, $body));
27
+
28
+        $actual = $this->client->applications->create('app');
29
+
30
+        $this->assertRequest($request);
31
+
32
+        self::assertNotNull($actual);
33
+        
34
+        self::assertEquals($actual->_message, "created");
35
+        self::assertEquals($actual->appId, "20468599130939380");
36
+        self::assertEquals($actual->apiId, "99f9d6f6-3f08-11e7-9fd1-06660ad2b8e6");
37
+    }
38
+
39
+    function testApplicationList()
40
+    {
41
+        $request = new PlivoRequest(
42
+            'GET',
43
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
44
+            []);
45
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationListResponse.json');
46
+
47
+        $this->mock(new PlivoResponse($request,200, $body));
48
+
49
+        $actual = $this->client->applications->list;
50
+
51
+        $this->assertRequest($request);
52
+
53
+        self::assertNotNull($actual);
54
+
55
+        foreach ($actual as $actualApplication) {
56
+            self::assertEquals(substr($actualApplication->resourceUri, 0, 33), "/v1/Account/MAXXXXXXXXXXXXXXXXXX/");
57
+        }
58
+    }
59
+
60
+    function testApplicationDetails()
61
+    {
62
+        $request = new PlivoRequest(
63
+            'GET',
64
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/20468599130939380/',
65
+            []);
66
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationGetResponse.json');
67
+
68
+        $this->mock(new PlivoResponse($request,200, $body));
69
+
70
+        $actual = $this->client->applications->get("20468599130939380");
71
+
72
+        $this->assertRequest($request);
73
+
74
+        self::assertNotNull($actual);
75
+
76
+        self::assertEquals($actual->getId(), "20468599130939380");
77
+    }
78
+
79
+    function testApplicationUpdate()
80
+    {
81
+        $request = new PlivoRequest(
82
+            'POST',
83
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/app/',
84
+            [
85
+                'subaccount' => "name"
86
+            ]);
87
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationModifyResponse.json');
88
+
89
+        $this->mock(new PlivoResponse($request,200, $body));
90
+
91
+        $actual = $this->client->applications->update("app", ['subaccount'=>'name']);
92
+
93
+        $this->assertRequest($request);
94
+
95
+        self::assertNotNull($actual);
96
+
97
+        self::assertEquals($actual->apiId, "9b43ea74-3f08-11e7-8bc8-065f6a74a84a");
98
+        self::assertEquals($actual->message, "changed");
99
+
100
+    }
101
+}
0 102
\ No newline at end of file
Browse code

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

DoubleBastionAdmin authored on 05/11/2025 13:12:22
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,101 +0,0 @@
1
-<?php
2
-
3
-namespace Resources;
4
-
5
-
6
-use Plivo\Http\PlivoRequest;
7
-use Plivo\Http\PlivoResponse;
8
-use Plivo\Tests\BaseTestCase;
9
-
10
-/**
11
- * Class ApplicationTest
12
- * @package Resources
13
- */
14
-class ApplicationTest extends BaseTestCase
15
-{
16
-    function testApplicationCreate()
17
-    {
18
-        $request = new PlivoRequest(
19
-            'POST',
20
-            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
21
-            [
22
-                'app_name' => 'app'
23
-            ]);
24
-        $body = file_get_contents(__DIR__ . '/../Mocks/applicationCreateResponse.json');
25
-
26
-        $this->mock(new PlivoResponse($request,201, $body));
27
-
28
-        $actual = $this->client->applications->create('app');
29
-
30
-        $this->assertRequest($request);
31
-
32
-        self::assertNotNull($actual);
33
-        
34
-        self::assertEquals($actual->_message, "created");
35
-        self::assertEquals($actual->appId, "20468599130939380");
36
-        self::assertEquals($actual->apiId, "99f9d6f6-3f08-11e7-9fd1-06660ad2b8e6");
37
-    }
38
-
39
-    function testApplicationList()
40
-    {
41
-        $request = new PlivoRequest(
42
-            'GET',
43
-            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
44
-            []);
45
-        $body = file_get_contents(__DIR__ . '/../Mocks/applicationListResponse.json');
46
-
47
-        $this->mock(new PlivoResponse($request,200, $body));
48
-
49
-        $actual = $this->client->applications->list;
50
-
51
-        $this->assertRequest($request);
52
-
53
-        self::assertNotNull($actual);
54
-
55
-        foreach ($actual as $actualApplication) {
56
-            self::assertEquals(substr($actualApplication->resourceUri, 0, 33), "/v1/Account/MAXXXXXXXXXXXXXXXXXX/");
57
-        }
58
-    }
59
-
60
-    function testApplicationDetails()
61
-    {
62
-        $request = new PlivoRequest(
63
-            'GET',
64
-            'Account/MAXXXXXXXXXXXXXXXXXX/Application/20468599130939380/',
65
-            []);
66
-        $body = file_get_contents(__DIR__ . '/../Mocks/applicationGetResponse.json');
67
-
68
-        $this->mock(new PlivoResponse($request,200, $body));
69
-
70
-        $actual = $this->client->applications->get("20468599130939380");
71
-
72
-        $this->assertRequest($request);
73
-
74
-        self::assertNotNull($actual);
75
-
76
-        self::assertEquals($actual->getId(), "20468599130939380");
77
-    }
78
-
79
-    function testApplicationUpdate()
80
-    {
81
-        $request = new PlivoRequest(
82
-            'POST',
83
-            'Account/MAXXXXXXXXXXXXXXXXXX/Application/app/',
84
-            [
85
-                'subaccount' => "name"
86
-            ]);
87
-        $body = file_get_contents(__DIR__ . '/../Mocks/applicationModifyResponse.json');
88
-
89
-        $this->mock(new PlivoResponse($request,200, $body));
90
-
91
-        $actual = $this->client->applications->update("app", ['subaccount'=>'name']);
92
-
93
-        $this->assertRequest($request);
94
-
95
-        self::assertNotNull($actual);
96
-
97
-        self::assertEquals($actual->apiId, "9b43ea74-3f08-11e7-8bc8-065f6a74a84a");
98
-        self::assertEquals($actual->message, "changed");
99
-
100
-    }
101
-}
102 0
\ No newline at end of file
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,101 @@
1
+<?php
2
+
3
+namespace Resources;
4
+
5
+
6
+use Plivo\Http\PlivoRequest;
7
+use Plivo\Http\PlivoResponse;
8
+use Plivo\Tests\BaseTestCase;
9
+
10
+/**
11
+ * Class ApplicationTest
12
+ * @package Resources
13
+ */
14
+class ApplicationTest extends BaseTestCase
15
+{
16
+    function testApplicationCreate()
17
+    {
18
+        $request = new PlivoRequest(
19
+            'POST',
20
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
21
+            [
22
+                'app_name' => 'app'
23
+            ]);
24
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationCreateResponse.json');
25
+
26
+        $this->mock(new PlivoResponse($request,201, $body));
27
+
28
+        $actual = $this->client->applications->create('app');
29
+
30
+        $this->assertRequest($request);
31
+
32
+        self::assertNotNull($actual);
33
+        
34
+        self::assertEquals($actual->_message, "created");
35
+        self::assertEquals($actual->appId, "20468599130939380");
36
+        self::assertEquals($actual->apiId, "99f9d6f6-3f08-11e7-9fd1-06660ad2b8e6");
37
+    }
38
+
39
+    function testApplicationList()
40
+    {
41
+        $request = new PlivoRequest(
42
+            'GET',
43
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/',
44
+            []);
45
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationListResponse.json');
46
+
47
+        $this->mock(new PlivoResponse($request,200, $body));
48
+
49
+        $actual = $this->client->applications->list;
50
+
51
+        $this->assertRequest($request);
52
+
53
+        self::assertNotNull($actual);
54
+
55
+        foreach ($actual as $actualApplication) {
56
+            self::assertEquals(substr($actualApplication->resourceUri, 0, 33), "/v1/Account/MAXXXXXXXXXXXXXXXXXX/");
57
+        }
58
+    }
59
+
60
+    function testApplicationDetails()
61
+    {
62
+        $request = new PlivoRequest(
63
+            'GET',
64
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/20468599130939380/',
65
+            []);
66
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationGetResponse.json');
67
+
68
+        $this->mock(new PlivoResponse($request,200, $body));
69
+
70
+        $actual = $this->client->applications->get("20468599130939380");
71
+
72
+        $this->assertRequest($request);
73
+
74
+        self::assertNotNull($actual);
75
+
76
+        self::assertEquals($actual->getId(), "20468599130939380");
77
+    }
78
+
79
+    function testApplicationUpdate()
80
+    {
81
+        $request = new PlivoRequest(
82
+            'POST',
83
+            'Account/MAXXXXXXXXXXXXXXXXXX/Application/app/',
84
+            [
85
+                'subaccount' => "name"
86
+            ]);
87
+        $body = file_get_contents(__DIR__ . '/../Mocks/applicationModifyResponse.json');
88
+
89
+        $this->mock(new PlivoResponse($request,200, $body));
90
+
91
+        $actual = $this->client->applications->update("app", ['subaccount'=>'name']);
92
+
93
+        $this->assertRequest($request);
94
+
95
+        self::assertNotNull($actual);
96
+
97
+        self::assertEquals($actual->apiId, "9b43ea74-3f08-11e7-8bc8-065f6a74a84a");
98
+        self::assertEquals($actual->message, "changed");
99
+
100
+    }
101
+}
0 102
\ No newline at end of file