Skip to content

Commit

Permalink
Fix tests to be able to finish it without a fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Sep 8, 2018
1 parent 92671a5 commit a09379f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ php:
- hhvm
- nightly

services:
- mysql

matrix:
include:
- php: "5.3"
Expand All @@ -20,5 +23,8 @@ matrix:
- php: nightly
- php: hhvm

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'

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"
5 changes: 4 additions & 1 deletion tests/Connection/CustomTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions tests/ManagerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }
Expand Down

0 comments on commit a09379f

Please sign in to comment.