/** * @covers ::__construct * @covers ::reuseConnection * @covers ::getConnection * @covers ::setConnection * @covers ::connect * @covers \Minphp\Db\SqliteConnection::makeDsn * @covers ::makeConnection */ public function testReuseConnection() { $dbInfo = $this->getDbInfo(); $connectionA = new SqliteConnection($dbInfo); $pdoA = $connectionA->connect(); $connectionB = new SqliteConnection($dbInfo); $pdoB = $connectionB->reuseConnection(true)->connect(); $connectionC = new SqliteConnection($dbInfo); $pdoC = $connectionC->reuseConnection(false)->connect(); $this->assertSame($pdoA, $pdoB); $this->assertNotSame($pdoA, $pdoC); }
/** * @covers ::makeDsn * @uses \Minphp\Db\PdoConnection */ public function testMakeDsn() { $connection = new SqliteConnection(array()); $this->assertEquals('sqlite::memory:', $connection->makeDsn(array('driver' => 'sqlite', 'database' => ':memory:'))); }