Пример #1
0
 public function testGetConnectionsWithSameName()
 {
     Connection::init($this->getAuthData(), self::CONNECTION_NAME, $this->getDBType());
     $a = Connection::get(self::CONNECTION_NAME, $this->getDBType());
     $b = Connection::get(self::CONNECTION_NAME, $this->getDBType());
     $this->assertTrue($a instanceof PDO);
     $this->assertTrue($b instanceof PDO);
     $this->assertTrue($a === $b);
 }
 public static function setUpBeforeClass()
 {
     echo PHP_EOL . "### Mysql testing" . PHP_EOL;
     Connection::init(array("username" => "root", "password" => "root", "dbname" => "memory-test-schema", "host" => "localhost", "port" => 3306), self::CONNECTION_NAME, Connection::MYSQL);
     self::$manager = new PersistencyManager(Connection::get(self::CONNECTION_NAME, Connection::MYSQL));
 }
Пример #3
0
 public static function setUpBeforeClass()
 {
     echo PHP_EOL . "### Postgres testing" . PHP_EOL;
     Connection::init(array("username" => "postgres", "password" => "postgres", "dbname" => "memory-test-schema", "host" => "localhost", "port" => 5432), self::CONNECTION_NAME, Connection::POSTGRES);
     self::$manager = new PersistencyManager(Connection::get(self::CONNECTION_NAME, Connection::POSTGRES));
 }