Little refactopring on tests config file

This commit is contained in:
Alejandro Celaya 2019-01-29 13:05:26 +01:00
parent bc61b55b94
commit ea1b285d52

View file

@ -7,8 +7,12 @@ use GuzzleHttp\Client;
use Zend\ConfigAggregator\ConfigAggregator;
use Zend\ServiceManager\Factory\InvokableFactory;
use function realpath;
use function sprintf;
use function sys_get_temp_dir;
$swooleTestingHost = '127.0.0.1';
$swooleTestingPort = 9999;
return [
'debug' => true,
@ -23,8 +27,8 @@ return [
'zend-expressive-swoole' => [
'swoole-http-server' => [
'port' => 9999,
'host' => '127.0.0.1',
'host' => $swooleTestingHost,
'port' => $swooleTestingPort,
'process-name' => 'shlink_test',
'options' => [
'pid_file' => sys_get_temp_dir() . '/shlink-test-swoole.pid',
@ -33,11 +37,13 @@ return [
],
'dependencies' => [
'services' => [
'shlink_test_api_client' => new Client([
'base_uri' => sprintf('http://%s:%s/', $swooleTestingHost, $swooleTestingPort),
]),
],
'factories' => [
Common\TestHelper::class => InvokableFactory::class,
'shlink_test_api_client' => function () {
return new Client(['base_uri' => 'http://localhost:9999/']);
},
],
],