/** @inheritdoc */
 public function create($transactionName, $connectionName)
 {
     /** @var \Praxigento\Core\Transaction\Database\Def\Item $result */
     $result = $this->_manObj->create(\Praxigento\Core\Transaction\Database\Def\Item::class);
     $result->setTransactionName($transactionName);
     $result->setConnectionName($connectionName);
     if ($transactionName != \Praxigento\Core\Transaction\Database\IManager::DEF_TRANSACTION || $connectionName != \Praxigento\Core\Transaction\Database\IManager::DEF_CONNECTION) {
         /* create new connection, don't use default connection/transaction */
         /* 'db/connection/default' */
         $cfgName = \Magento\Framework\Config\ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS . '/' . $connectionName;
         /* {'host'=>'', 'dbname'=>'', 'username'=>'', 'password'=>'', 'model'=>'', 'engine'=>'', 'initStatements'=>'', 'active'=>''}*/
         $cfgData = $this->_configDeployment->get($cfgName);
         /* @var \Magento\Framework\DB\Adapter\AdapterInterface $dba */
         $conn = $this->_factoryConn->create($cfgData);
         $result->setConnection($conn);
     }
     return $result;
 }
 public function testGetTriggerName()
 {
     $tableName = 'subject_table';
     $time = 'before';
     $event = 'insert';
     $triggerName = 'trg_subject_table_before_insert';
     $this->connectionFactory->expects($this->once())->method('create')->will($this->returnValue($this->connection));
     $this->connection->expects($this->once())->method('getTriggerName')->with($tableName, $time, $event)->willReturn($triggerName);
     $this->assertSame($triggerName, $this->resource->getTriggerName($tableName, $time, $event));
 }
 /**
  * Retrieve connection by $connectionName
  *
  * @param string $connectionName
  * @return \Magento\Framework\DB\Adapter\AdapterInterface
  * @throws \DomainException
  */
 public function getConnectionByName($connectionName)
 {
     if (isset($this->connections[$connectionName])) {
         return $this->connections[$connectionName];
     }
     $connectionConfig = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS . '/' . $connectionName);
     if ($connectionConfig) {
         $connection = $this->connectionFactory->create($connectionConfig);
     } else {
         throw new \DomainException('Connection "' . $connectionName . '" is not defined');
     }
     $this->connections[$connectionName] = $connection;
     return $connection;
 }