forked from Oanitya/AgoraDynamicKey
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDynamicKeyTest.php
50 lines (41 loc) · 1.44 KB
/
DynamicKeyTest.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
<?php
namespace Agora\AgoraDynamicKey\Test;
use PHPUnit\Framework\TestCase;
class DynamicKeyTest extends TestCase
{
private $appID = '970ca35de60c44645bbae8a215061b33';
private $appCertificate = '5cfd2fd1755d40ecb72977518be15d3b';
private $channelName = "7d72365eb983485397e3e3f9d460bdda";
private $ts = 1446455472;
private $randomInt = 58964981;
private $uid = 2882341273;
private $expiredTs = 1446455471;
public function testRecordingKey()
{
$expected = '004e0c24ac56aae05229a6d9389860a1a0e25e56da8970ca35de60c44645bbae8a215061b3314464554720383bbf51446455471';
$actual = \Agora\AgoraDynamicKey\DynamicKey4::generateRecordingKey(
$this->appID,
$this->appCertificate,
$this->channelName,
$this->ts,
$this->randomInt,
$this->uid,
$this->expiredTs
);
$this->assertEquals($expected, $actual);
}
public function testMediaChannelKey()
{
$expected = '004d0ec5ee3179c964fe7c0485c045541de6bff332b970ca35de60c44645bbae8a215061b3314464554720383bbf51446455471';
$actual = \Agora\AgoraDynamicKey\DynamicKey4::generateMediaChannelKey(
$this->appID,
$this->appCertificate,
$this->channelName,
$this->ts,
$this->randomInt,
$this->uid,
$this->expiredTs
);
$this->assertEquals($expected, $actual);
}
}