Commit 6b34f031 authored by Steve Müller's avatar Steve Müller

add test for connecting without database name on capable platforms

parent e6073abe
......@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\ConnectionException;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Types\Type;
require_once __DIR__ . '/../../TestInit.php';
......@@ -223,4 +224,25 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->assertTrue($this->_conn->ping());
$this->assertTrue($this->_conn->isConnected());
}
/**
* @group DBAL-1025
*/
public function testConnectWithoutExplicitDatabaseName()
{
if (in_array($this->_conn->getDatabasePlatform()->getName(), array('oracle', 'db2'), true)) {
$this->markTestSkipped('Platform does not support connecting without database name.');
}
$params = $this->_conn->getParams();
unset($params['dbname']);
$connection = DriverManager::getConnection(
$params,
$this->_conn->getConfiguration(),
$this->_conn->getEventManager()
);
$this->assertTrue($connection->connect());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment