1
0
mirror of synced 2024-12-13 06:46:03 +03:00

Small fix

This commit is contained in:
zYne 2006-09-22 22:29:06 +00:00
parent e49a686a3b
commit 0173d0aaed
2 changed files with 15 additions and 5 deletions

View File

@ -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);

View File

@ -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);
}
}
?>