-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpunit.php
44 lines (34 loc) · 1.14 KB
/
phpunit.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
<?php
if(!class_exists('PHPUnit_TextUI_Command', false)){
exit('THIS IS FOR PHPUNIT RUN ONLY');
}
//SDK初始化
require __DIR__. '/src/QcloudApi/Integrate/Loader.php';
\QcloudApi\Integrate\Loader::getInstance()->reg2SPL();
//初始化Service Locator
$serviceLocatorConfig = array(
'configFile' => array(
__DIR__. '/testsmock/LoaderConfig/ServiceLocatorDefault.php',
__DIR__. '/testsmock/LoaderConfig/ServiceLocatorPHPUnit.php',
__DIR__. '/testsmock/LoaderConfig/ServiceLocatorProduction.php',
),
);
\QcloudApi\Integrate\ServiceLocator::getInstance($serviceLocatorConfig);
//mock初始化
require __DIR__ . '/testsmock/Class/Testsmoke_Loader.php';
Testsmoke_Loader::regLoadClassPath("testcase", __DIR__. '/tests');
Testsmoke_Loader::define(array(
'D_APP_DIR' => __DIR__ . '/testsmock',
'D_ENTRY_FILE' => __FILE__,
'D_ENV' => 'Dev',
));
$printPHPUnit = function($buffer = ""){
echo PHP_EOL;
if(!empty($buffer)){
echo "\x1b[30;42m". $buffer. "\x1b[0m";
}
};
$printPHPUnit();
$printPHPUnit("PHPUnit Test Prepare OK");
$printPHPUnit();
$printPHPUnit();