|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (C) eZ Systems AS. All rights reserved. |
|
5
|
|
|
* @license For full copyright and license information view LICENSE file distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
namespace eZ\Bundle\EzPublishCoreBundle\Tests\DependencyInjection\Configuration\Parser; |
|
8
|
|
|
|
|
9
|
|
|
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ComplexSettings\ComplexSettingParser; |
|
10
|
|
|
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\IO; |
|
11
|
|
|
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\EzPublishCoreExtension; |
|
12
|
|
|
use Symfony\Component\Yaml\Yaml; |
|
13
|
|
|
|
|
14
|
|
|
class IOTest extends AbstractParserTestCase |
|
15
|
|
|
{ |
|
16
|
|
|
private $minimalConfig; |
|
17
|
|
|
|
|
18
|
|
|
protected function setUp(): void |
|
19
|
|
|
{ |
|
20
|
|
|
parent::setUp(); |
|
21
|
|
|
$this->container->setParameter('ezsettings.default.var_dir', 'var'); // PS: Does not seem to take effect |
|
22
|
|
|
$this->container->setParameter('ezsettings.default.storage_dir', 'storage'); |
|
23
|
|
|
$this->container->setParameter('ezsettings.ezdemo_site.var_dir', 'var/ezdemo_site'); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
protected function getContainerExtensions(): array |
|
27
|
|
|
{ |
|
28
|
|
|
return [ |
|
29
|
|
|
new EzPublishCoreExtension([new IO(new ComplexSettingParser())]), |
|
30
|
|
|
]; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
protected function getMinimalConfiguration(): array |
|
34
|
|
|
{ |
|
35
|
|
|
return $this->minimalConfig = Yaml::parse(file_get_contents(__DIR__ . '/../../Fixtures/ezpublish_minimal.yml')); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function testHandlersConfig() |
|
39
|
|
|
{ |
|
40
|
|
|
$config = [ |
|
41
|
|
|
'system' => [ |
|
42
|
|
|
'ezdemo_site' => [ |
|
43
|
|
|
'io' => [ |
|
44
|
|
|
'binarydata_handler' => 'cluster', |
|
45
|
|
|
'metadata_handler' => 'cluster', |
|
46
|
|
|
], |
|
47
|
|
|
], |
|
48
|
|
|
], |
|
49
|
|
|
]; |
|
50
|
|
|
|
|
51
|
|
|
$this->load($config); |
|
52
|
|
|
|
|
53
|
|
|
$this->assertConfigResolverParameterValue('io.metadata_handler', 'cluster', 'ezdemo_site'); |
|
54
|
|
|
$this->assertConfigResolverParameterValue('io.binarydata_handler', 'cluster', 'ezdemo_site'); |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|