-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTestCase.php
56 lines (51 loc) · 1.92 KB
/
TestCase.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
<?php
namespace Calchen\LaravelDingtalkRobot\Test;
use Calchen\LaravelDingtalkRobot\DingtalkRobotNoticeServiceProvider;
use Calchen\LaravelDingtalkRobot\Facade;
use Orchestra\Testbench\TestCase as TestbenchTestCase;
class TestCase extends TestbenchTestCase
{
protected function getPackageProviders($app)
{
return [GuzzleProvider::class, DingtalkRobotNoticeServiceProvider::class];
}
protected function getPackageAliases($app)
{
return [
'DingtalkRobot' => Facade::class,
];
}
protected function getEnvironmentSetUp($app)
{
$app['config']->set('dingtalk_robot', [
'http_client_name' => null,
// 因为没有旧的机器人故无法测试
// 'default' => [
// 'access_token' => env('DINGTALK_ROBOT_DEFAULT_ACCESS_TOKEN'),
// 'timeout' => 2.0,
// 'security_type' => null,
// ],
'keywords' => [
'access_token' => env('DINGTALK_ROBOT_KEYWORDS_ACCESS_TOKEN'),
'timeout' => 5.0,
'security_types' => [
'keywords',
],
],
'signature' => [
'access_token' => env('DINGTALK_ROBOT_SIGNATURE_ACCESS_TOKEN'),
'timeout' => 5.0,
'security_types' => [
'signature',
],
'security_signature' => env('DINGTALK_ROBOT_SIGNATURE_SECURITY_VALUES'),
],
// 无法控制 travis ip,故这个测试跳过
// 'ip' => [
// 'access_token' => env('DINGTALK_ROBOT_ACCESS_TOKEN'),
// 'timeout' => 2.0,
// 'security_type' => 'ip',
// ],
]);
}
}