Skip to content

Instantly share code, notes, and snippets.

@bitwombat
Created February 5, 2017 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitwombat/df51fb62aa45d7e30d40ceb68605b93b to your computer and use it in GitHub Desktop.
Save bitwombat/df51fb62aa45d7e30d40ceb68605b93b to your computer and use it in GitHub Desktop.
merge/overrides don't seem to be working correctly...
public function setUp()
{
// The module configuration should still be applicable for tests.
// You can override configuration here with test case specific values,
// such as sample view templates, path stacks, module_listener_options,
// etc.
$configOverrides = [
'doctrine' => [
'connection' => [
// Configuration for service `doctrine.connection.orm_default` service
'orm_default' => [
// configuration instance to use. The retrieved service name will
// be `doctrine.configuration.$thisSetting`
'configuration' => 'orm_default',
// event manager instance to use. The retrieved service name will
// be `doctrine.eventmanager.$thisSetting`
'eventmanager' => 'orm_default',
'params' => [
'driver' => 'sqlite',
'user' => 'project',
'password' => 'project',
'memory' => true,
],
],
],
],
];
$this->setApplicationConfig(ArrayUtils::merge(
// Grabbing the full application configuration:
include __DIR__ . '/../../../../config/application.config.php',
$configOverrides
));
parent::setUp();
$services = $this->getApplicationServiceLocator();
$config = $services->get('config'); // $config doesn't have a 'doctrine' key
// unset($config['doctrine']);
$services->setAllowOverride(true);
$services->setService('config', $config);
$services->setAllowOverride(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment