Example #1
0
 /**
  * Union migrate manager constructor.
  *
  * @param null $plugin
  */
 public function __construct($plugin = null)
 {
     if (Plugin::loaded($plugin)) {
         $this->_connectionConfig = ConnectionManager::config($this->_connectionName);
         $this->_adapterName = $this->_getAdapterName($this->_connectionConfig['driver']);
         $config = ['paths' => ['migrations' => UnionPlugin::migrationPath($plugin)], 'environments' => $this->_configuration()];
         $this->_plugin = $plugin;
         $this->_config = new Config($config);
         $adapterOptions = $this->_config->getEnvironment($this->_connectionName);
         $this->_adapter = $this->_setAdapter($adapterOptions);
     }
 }
Example #2
0
 /**
  * @covers \Phinx\Config\Config::getEnvironment
  */
 public function testGetEnvironmentMethod()
 {
     $config = new Config($this->getConfigArray());
     $db = $config->getEnvironment('testing');
     $this->assertEquals('sqllite', $db['adapter']);
 }