mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
[ticket/12620] Fix tests
PHPBB3-12620
This commit is contained in:
parent
3a167aa0c3
commit
0b61e3540d
3 changed files with 18 additions and 1 deletions
|
@ -195,6 +195,8 @@ class container_builder
|
||||||
$loader = new YamlFileLoader($this->container, new FileLocator(phpbb_realpath($this->get_config_path())));
|
$loader = new YamlFileLoader($this->container, new FileLocator(phpbb_realpath($this->get_config_path())));
|
||||||
$loader->load(PHPBB_ENVIRONMENT . '/config.yml');
|
$loader->load(PHPBB_ENVIRONMENT . '/config.yml');
|
||||||
|
|
||||||
|
$this->inject_custom_parameters();
|
||||||
|
|
||||||
if ($this->compile_container)
|
if ($this->compile_container)
|
||||||
{
|
{
|
||||||
$this->container->compile();
|
$this->container->compile();
|
||||||
|
@ -430,6 +432,20 @@ class container_builder
|
||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inject the customs parameters into the container
|
||||||
|
*/
|
||||||
|
protected function inject_custom_parameters()
|
||||||
|
{
|
||||||
|
if ($this->custom_parameters !== null)
|
||||||
|
{
|
||||||
|
foreach ($this->custom_parameters as $key => $value)
|
||||||
|
{
|
||||||
|
$this->container->setParameter($key, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the core parameters.
|
* Returns the core parameters.
|
||||||
*
|
*
|
||||||
|
|
|
@ -146,7 +146,6 @@ namespace
|
||||||
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
|
||||||
|
|
||||||
$this->assertTrue($container->hasParameter('my_parameter'));
|
$this->assertTrue($container->hasParameter('my_parameter'));
|
||||||
$this->assertFalse($container->hasParameter('core.root_path'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
tests/di/fixtures/other_config/development/config.yml
Normal file
2
tests/di/fixtures/other_config/development/config.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
core:
|
||||||
|
require_dev_dependencies: true
|
Loading…
Add table
Reference in a new issue