Created a config prost-processor which adds the base path on every applicable configuration

This commit is contained in:
Alejandro Celaya
2019-09-13 20:03:53 +02:00
parent 76541d5563
commit d7a3aeb0a2
5 changed files with 52 additions and 4 deletions

View File

@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Core;
namespace ShlinkioTest\Shlink\Core\Config;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Core\SimplifiedConfigParser;
use Shlinkio\Shlink\Core\Config\SimplifiedConfigParser;
use function array_merge;
@@ -50,6 +50,7 @@ class SimplifiedConfigParserTest extends TestCase
'password' => 'bar',
'port' => '1234',
],
'base_path' => '/foo/bar',
];
$expected = [
'app_options' => [
@@ -96,6 +97,10 @@ class SimplifiedConfigParserTest extends TestCase
'tcp://1.2.2.2:2222',
],
],
'router' => [
'base_path' => '/foo/bar',
],
];
$result = ($this->postProcessor)(array_merge($config, $simplified));