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,36 @@
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 EndpointTest
12
+ * @package Resources
13
+ */
14
+class TokenTest extends BaseTestCase
15
+{
16
+    function testEndpointCreate()
17
+    {
18
+        $request = new PlivoRequest(
19
+            'POST',
20
+            'Account/MAXXXXXXXXXXXXXXXXXX/JWT/Token/',
21
+            [
22
+                "iss" => "MAXXXXXXXXXXXXXXXXXX"
23
+            ]);
24
+        $body = file_get_contents(__DIR__ . '/../Mocks/tokenCreteResponse.json');
25
+
26
+        $this->mock(new PlivoResponse($request,200, $body));
27
+
28
+        $actual = $this->client->token->create(
29
+            "MAXXXXXXXXXXXXXXXXXX"
30
+        );
31
+
32
+        $this->assertRequest($request);
33
+
34
+        self::assertNotNull($actual);
35
+    }
36
+}
0 37
\ No newline at end of file