diff --git a/.travis.yml b/.travis.yml index bfc2d3066..65abd25d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,9 @@ php: - hhvm - nightly +services: + - mysql + matrix: include: - php: "5.3" @@ -20,8 +23,11 @@ matrix: - php: nightly - php: hhvm +before_install: + - mysql -e 'CREATE DATABASE IF NOT EXISTS test;' + before_script: - - composer install + - composer install script: - - php -dshort_open_tag=Off -dmagic_quotes_gpc=Off tests/index.php + - "cd tests && php -dshort_open_tag=Off -dmagic_quotes_gpc=Off run.php" diff --git a/tests/Connection/CustomTestCase.php b/tests/Connection/CustomTestCase.php index badb87d77..19c3e2f9a 100644 --- a/tests/Connection/CustomTestCase.php +++ b/tests/Connection/CustomTestCase.php @@ -49,7 +49,10 @@ public function testConnection() class Doctrine_Connection_Test extends Doctrine_Connection_Common { - + /** + * @var string $driverName the name of this connection driver + */ + protected $driverName = 'Mock'; } class Doctrine_Adapter_Test implements Doctrine_Adapter_Interface diff --git a/tests/ManagerTestCase.php b/tests/ManagerTestCase.php index 4765a6256..f9becd851 100644 --- a/tests/ManagerTestCase.php +++ b/tests/ManagerTestCase.php @@ -164,14 +164,24 @@ public function testDropDatabases() public function testConnectionInformationDecoded() { + $e = null; $dsn = 'mysql://' . urlencode('test/t') . ':' . urlencode('p@ssword') . '@localhost/' . urlencode('db/name'); - $conn = Doctrine_Manager::connection($dsn); - $options = $conn->getOptions(); + try { + $conn = Doctrine_Manager::connection($dsn); + $options = $conn->getOptions(); - $this->assertEqual($options['username'], 'test/t'); - $this->assertEqual($options['password'], 'p@ssword'); - $this->assertEqual($options['dsn'], 'mysql:host=localhost;dbname=db/name'); + $this->assertEqual($options['username'], 'test/t'); + $this->assertEqual($options['password'], 'p@ssword'); + $this->assertEqual($options['dsn'], 'mysql:host=localhost;dbname=db/name'); + } catch (Exception $e) { + } + + Doctrine_Manager::getInstance()->closeConnection($conn); + + if (null !== $e) { + throw $e; + } } public function prepareData() { } public function prepareTables() { }