mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-19 00:39:55 +03:00
Little refactopring on tests config file
This commit is contained in:
parent
bc61b55b94
commit
ea1b285d52
1 changed files with 11 additions and 5 deletions
|
@ -7,8 +7,12 @@ use GuzzleHttp\Client;
|
||||||
use Zend\ConfigAggregator\ConfigAggregator;
|
use Zend\ConfigAggregator\ConfigAggregator;
|
||||||
use Zend\ServiceManager\Factory\InvokableFactory;
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
||||||
use function realpath;
|
use function realpath;
|
||||||
|
use function sprintf;
|
||||||
use function sys_get_temp_dir;
|
use function sys_get_temp_dir;
|
||||||
|
|
||||||
|
$swooleTestingHost = '127.0.0.1';
|
||||||
|
$swooleTestingPort = 9999;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'debug' => true,
|
'debug' => true,
|
||||||
|
@ -23,8 +27,8 @@ return [
|
||||||
|
|
||||||
'zend-expressive-swoole' => [
|
'zend-expressive-swoole' => [
|
||||||
'swoole-http-server' => [
|
'swoole-http-server' => [
|
||||||
'port' => 9999,
|
'host' => $swooleTestingHost,
|
||||||
'host' => '127.0.0.1',
|
'port' => $swooleTestingPort,
|
||||||
'process-name' => 'shlink_test',
|
'process-name' => 'shlink_test',
|
||||||
'options' => [
|
'options' => [
|
||||||
'pid_file' => sys_get_temp_dir() . '/shlink-test-swoole.pid',
|
'pid_file' => sys_get_temp_dir() . '/shlink-test-swoole.pid',
|
||||||
|
@ -33,11 +37,13 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
'dependencies' => [
|
'dependencies' => [
|
||||||
|
'services' => [
|
||||||
|
'shlink_test_api_client' => new Client([
|
||||||
|
'base_uri' => sprintf('http://%s:%s/', $swooleTestingHost, $swooleTestingPort),
|
||||||
|
]),
|
||||||
|
],
|
||||||
'factories' => [
|
'factories' => [
|
||||||
Common\TestHelper::class => InvokableFactory::class,
|
Common\TestHelper::class => InvokableFactory::class,
|
||||||
'shlink_test_api_client' => function () {
|
|
||||||
return new Client(['base_uri' => 'http://localhost:9999/']);
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue