/** * @group DBAL-1215 */ public function testReturnsDatabaseNameWithoutDatabaseNameParameter() { $params = $this->_conn->getParams(); unset($params['dbname']); $connection = new Connection($params, $this->_conn->getDriver(), $this->_conn->getConfiguration(), $this->_conn->getEventManager()); $this->assertSame($this->getDatabaseNameForConnectionWithoutDatabaseNameParameter(), $this->driver->getDatabase($connection)); }
public function testReturnsDatabaseName() { $params = array('user' => 'foo', 'password' => 'bar', 'dbname' => 'baz'); $connection = $this->getConnectionMock(); $connection->expects($this->once())->method('getParams')->will($this->returnValue($params)); $this->assertSame($params['dbname'], $this->driver->getDatabase($connection)); }
/** * Gets the name of the database this Connection is connected to. * * @return string */ public function getDatabase() { return $this->_driver->getDatabase($this); }