Ejemplo n.º 1
0
 /**
  *
  */
 public function testPackageEvironmentOverride()
 {
     $fileSystem = $this->getFileSystem();
     $fileSystem->shouldReceive('exists')->once()->with('/app/config/packages/baz/settings.php')->andReturn(false);
     $fileSystem->shouldReceive('exists')->once()->with('/app/packages/baz/config/settings.php')->andReturn(true);
     $fileSystem->shouldReceive('includeFile')->once()->with('/app/packages/baz/config/settings.php')->andReturn(['greeting' => 'hello', 'goodbye' => 'sayonara']);
     $fileSystem->shouldReceive('exists')->once()->with('/app/config/packages/baz/dev/settings.php')->andReturn(false);
     $fileSystem->shouldReceive('exists')->once()->with('/app/packages/baz/config/dev/settings.php')->andReturn(true);
     $fileSystem->shouldReceive('includeFile')->once()->with('/app/packages/baz/config/dev/settings.php')->andReturn(['greeting' => 'konnichiwa']);
     $config = new Config($fileSystem, '/app/config');
     $config->setEnvironment('dev');
     $config->registerNamespace('baz', '/app/packages/baz/config');
     $this->assertEquals('konnichiwa', $config->get('baz::settings.greeting'));
     $this->assertEquals('sayonara', $config->get('baz::settings.goodbye'));
 }