diff --git a/Doctrine/DB/EventListener/Interface.php b/Doctrine/DB/EventListener/Interface.php index 709162a25..801ba1df5 100644 --- a/Doctrine/DB/EventListener/Interface.php +++ b/Doctrine/DB/EventListener/Interface.php @@ -25,7 +25,7 @@ * @license LGPL * @package Doctrine */ -interface Doctrine_DB_EventListener { +interface Doctrine_DB_EventListener_Interface { public function onPreQuery(Doctrine_DB $dbh, array $args); public function onQuery(Doctrine_DB $dbh, array $args); diff --git a/tests/DBTestCase.php b/tests/DBTestCase.php index 81be660a1..4534c1d02 100644 --- a/tests/DBTestCase.php +++ b/tests/DBTestCase.php @@ -50,14 +50,24 @@ class Doctrine_DB_TestCase extends Doctrine_UnitTestCase { $this->pass(); } } + public function testGetConnectionPdoLikeDSN() { + $conn = Doctrine_DB2::getConnection('mysql:host=localhost;dbname=test', 'root', 'password'); + $this->assertEqual($conn->getDSN(), 'mysql:host=localhost;dbname=test'); + $this->assertEqual($conn->getUsername(), 'root'); + $this->assertEqual($conn->getPassword(), 'password'); - public function testGetConnection() { + + $conn = Doctrine_DB2::getConnection('sqlite::memory:'); + + $this->assertEqual($conn->getDSN(), 'sqlite::memory:'); + $this->assertEqual($conn->getUsername(), null); + $this->assertEqual($conn->getPassword(), null); + } + public function testGetConnectionWithPearLikeDSN() { $conn = Doctrine_DB2::getConnection('mysql://zYne:password@localhost/test'); $this->assertEqual($conn->getDSN(), 'mysql:host=localhost;dbname=test'); $this->assertEqual($conn->getUsername(), 'zYne'); $this->assertEqual($conn->getPassword(), 'password'); - - $conn = Doctrine_DB2::getConnection('sqlite://:memory:'); @@ -65,6 +75,6 @@ class Doctrine_DB_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($conn->getUsername(), null); $this->assertEqual($conn->getPassword(), null); } - + } ?>