/**
  * @static
  * @param $configurationName
  * @return IDataSource
  */
 public static function buildFromConfiguration($configurationName)
 {
     //get the connection data object
     $connectionData = ConnectionDataFactory::buildFromConfiguration($configurationName);
     //figure out which driver we need to build the data source object from
     $dataSourceConfiguration = Configuration::getDataSourceConfiguration($configurationName);
     $dataSourceClassName = 'Salvo\\Barrage\\DataSource\\Relational\\Driver\\' . $dataSourceConfiguration['driver'] . '\\' . 'DataSource';
     return $dataSourceClassName::getInstance($connectionData);
 }
 /**
  * @test
  */
 public function buildFromConfigurationMysqlWithcustom_portOptionsMysql()
 {
     $configurationName = 'ct_with_options';
     $connectionData = ConnectionDataFactory::buildFromConfiguration($configurationName);
     $this->assertSame(true, $connectionData instanceof Mysql\ConnectionData);
     $this->assertEquals('mysql', $connectionData->getDefaultDatabase());
     $this->assertEquals(array(\PDO::MYSQL_ATTR_READ_DEFAULT_FILE => '/etc/test'), $connectionData->getOptions());
     $this->assertEquals('root', $connectionData->getUsername());
     $this->assertEquals('password', $connectionData->getPassword());
     $this->assertEquals('mysql:dbname=mysql;host=127.0.0.1;port=1235', $connectionData->getConnectionString());
 }