1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests/Doctrine/Tests/DBAL/ConnectionTest.php
2009-07-14 22:36:09 +00:00

50 lines
1.2 KiB
PHP

<?php
namespace Doctrine\Tests\DBAL;
require_once __DIR__ . '/../TestInit.php';
class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{
public function setUp()
{
$params = array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'user' => 'root',
'password' => 'password',
'port' => '1234'
);
$this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params);
}
public function testGetHost()
{
$this->assertEquals('localhost', $this->_conn->getHost());
}
public function testGetPort()
{
$this->assertEquals('1234', $this->_conn->getPort());
}
public function testGetUsername()
{
$this->assertEquals('root', $this->_conn->getUsername());
}
public function testGetPassword()
{
$this->assertEquals('password', $this->_conn->getPassword());
}
public function testGetDriver()
{
$this->assertEquals('Doctrine\DBAL\Driver\PDOMySql\Driver', get_class($this->_conn->getDriver()));
}
public function testGetEventManager()
{
$this->assertEquals('Doctrine\Common\EventManager', get_class($this->_conn->getEventManager()));
}
}