-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathGraphTestCase.php
42 lines (33 loc) · 958 Bytes
/
GraphTestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Office365;
use PHPUnit\Framework\TestCase;
abstract class GraphTestCase extends TestCase
{
/**
* @var GraphServiceClient
*/
protected static $graphClient;
/**
* @var string
*/
protected static $testAccountName;
protected static $settings;
public static function setUpBeforeClass(): void
{
self::$settings = include(__DIR__ . '/Settings.php');
self::$testAccountName = self::$settings['TestAccountName'];
self::$graphClient = GraphServiceClient::withUserCredentials(
self::$settings['TenantName'],
self::$settings['ClientId'],
self::$settings['UserName'],
self::$settings['Password']
);
}
public static function tearDownAfterClass(): void
{
self::$graphClient = null;
}
public static function createUniqueName($prefix){
return $prefix . "_" . rand(1, 100000);
}
}