-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRingGroupTestCase.php
67 lines (55 loc) · 2.53 KB
/
RingGroupTestCase.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace KazooTests\Applications\Callflow;
use \KazooTests\TestCase;
use \MakeBusy\Kazoo\Applications\Crossbar\TestAccount;
abstract class RingGroupTestCase extends TestCase {
public static $user = array();
public static $device = array();
public static $ring_group_1;
public static $ring_group_2;
public static $ring_group_3;
public static $ring_group_4;
const RG_EXT_1 = '8001';
const RG_EXT_2 = '8002';
const RG_EXT_3 = '8003';
const RG_EXT_4 = '8004';
const DURATION = '30';
public static function setUpCase() {
foreach (range('a','g') as $letter) {
self::$user[$letter] = self::$account->createUser();
}
foreach (range('a','g') as $letter) {
self::$device[$letter] = self::$user[$letter]->createDevice("auth", true);
}
self::$ring_group_1 = self::$account->createRingGroup([self::RG_EXT_1],
[
["id" => self::$device['b']->getId(), "type" => "device", "timeout" => "30", "delay" => "0"],
["id" => self::$device['c']->getId(), "type" => "device", "timeout" => "25", "delay" => "5"],
["id" => self::$device['d']->getId(), "type" => "device", "timeout" => "20", "delay" => "10"],
["id" => self::$user['e']->getId(), "type" => "user", "timeout" => "15", "delay" => "15"],
["id" => self::$user['f']->getId(), "type" => "user", "timeout" => "10", "delay" => "20"],
["id" => self::$user['g']->getId(), "type" => "user", "timeout" => "5", "delay" => "25"]
]
);
self::$ring_group_2 = self::$account->createRingGroup([self::RG_EXT_2],
[
["id" => self::$device['b']->getId(), "type" => "device", "timeout" => "10"],
["id" => self::$device['c']->getId(), "type" => "device", "timeout" => "10"]
]
);
self::$ring_group_3 = self::$account->createRingGroup([self::RG_EXT_3],
[
["id" => self::$device['d']->getId(), "type" => "device", "timeout" => "10"],
["id" => self::$device['e']->getId(), "type" => "device", "timeout" => "10"]
],
"simultaneous"
);
self::$ring_group_4 = self::$account->createRingGroup([self::RG_EXT_4],
[
["id" => self::$device['f']->getId(), "type" => "device", "timeout" => "10"],
["id" => self::$device['g']->getId(), "type" => "device", "timeout" => "10"]
],
"single"
);
}
}