PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.32
Booking for Appointments and Events Calendar – Amelia v1.2.32
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / microsoft / microsoft-graph / tests / GraphTest.php
ameliabooking / vendor / microsoft / microsoft-graph / tests Last commit date
Core 1 year ago Exception 6 years ago Functional 1 year ago Http 1 year ago Model 1 year ago GetPhpInfo.php 1 year ago GraphTest.php 1 year ago
GraphTest.php
75 lines
1 <?php
2 use PHPUnit\Framework\TestCase;
3 use Microsoft\Graph\Core\GraphConstants;
4 use Microsoft\Graph\Graph;
5 use Microsoft\Graph\Http\GraphRequest;
6
7 class GraphTest extends TestCase
8 {
9 public function testGraphConstructor()
10 {
11 $graph = new Graph();
12 $this->assertNotNull($graph);
13 }
14
15 public function testInitializeEmptyGraph()
16 {
17 $this->expectException(Microsoft\Graph\Exception\GraphException::class);
18 $graph = new Graph();
19 $request = $graph->createRequest("GET", "/me");
20 }
21
22 public function testInitializeGraphWithToken()
23 {
24 $graph = new Graph();
25 $graph->setAccessToken('abc');
26 $request = $graph->createRequest("GET", "/me");
27
28 $this->assertInstanceOf(GraphRequest::class, $request);
29 }
30
31 public function testCreateCollectionRequest()
32 {
33 $graph = new Graph();
34 $graph->setAccessToken('abc');
35 $request = $graph->createCollectionRequest("GET", "/me");
36
37 $this->assertInstanceOf(GraphRequest::class, $request);
38 }
39
40 public function testRequestWithCustomEndpoint()
41 {
42 $graph = new Graph();
43 $graph->setAccessToken('abc');
44 $graph->setBaseUrl('url2');
45
46 $request = $graph->createRequest("GET", "/me");
47 $this->assertEquals('url2', $request->getBaseUrl());
48 }
49
50 public function testBetaRequest()
51 {
52 $graph = new Graph();
53 $graph->setAccessToken('abc')
54 ->setApiVersion('beta');
55 $request = $graph->createRequest("GET", "/me");
56
57 $this->assertEquals('beta', $request->getApiVersion());
58 }
59
60 public function testMultipleGraphObjects()
61 {
62 $graph = new Graph();
63 $graph2 = new Graph();
64
65 $graph->setAccessToken('abc');
66 $graph2->setAccessToken('abc');
67 $graph2->setApiVersion('beta');
68
69 $request = $graph->createRequest("GET", "/me");
70 $request2 = $graph2->createRequest("GET", "/me");
71
72 $this->assertEquals(GraphConstants::API_VERSION, $request->getApiVersion());
73 $this->assertEquals('beta', $request2->getApiVersion());
74 }
75 }