public function testStaticDatabase()
 {
     try {
         Database::getDatabase('', '', '', DriverParameter::DRIVER_PDO_SQLITE, 'sqlite::memory:');
     } catch (\Exception $E) {
     }
     try {
         Database::getDatabase('', '', '', 0, 'Wrong');
     } catch (\Exception $E) {
         $this->assertInstanceOf('MOC\\V\\Component\\Database\\Exception\\DatabaseException', $E);
     }
 }
 /**
  * @param string   $Username
  * @param string   $Password
  * @param string   $Database
  * @param string   $Driver
  * @param string   $Host
  * @param null|int $Port
  *
  * @param int      $Timeout
  *
  * @return Connection
  * @throws \Exception
  */
 public function setConnection($Username, $Password, $Database, $Driver, $Host, $Port, $Timeout = 5)
 {
     try {
         $this->Connection = Database::getDatabase($Username, $Password, $Database, $Driver, $Host, $Port, $Timeout);
     } catch (\Exception $E) {
         try {
             Database::getDatabase($Username, $Password, null, $Driver, $Host, $Port, $Timeout)->getSchemaManager()->createDatabase($Database);
             $this->Connection = Database::getDatabase($Username, $Password, $Database, $Driver, $Host, $Port, $Timeout);
         } catch (\Exception $E) {
             throw new \Exception($E->getMessage(), $E->getCode(), $E);
         }
     }
     return $this;
 }