Commit 0173d0aa authored by zYne's avatar zYne

Small fix

parent e49a686a
......@@ -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);
......
......@@ -50,15 +50,25 @@ 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:');
$this->assertEqual($conn->getDSN(), 'sqlite::memory:');
......
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