Skip to content

Commit

Permalink
Merge branch 'fix-tests-to-be-able-to-finish-it-without-a-fatal-error…
Browse files Browse the repository at this point in the history
…' into fix-more-than-one-record-generator-initialisation-on-same-php-process

* fix-tests-to-be-able-to-finish-it-without-a-fatal-error:
  Fix tests to be able to finish it without a fatal error
  • Loading branch information
alquerci committed Sep 10, 2018
2 parents c8d8cff + a09379f commit d244e0d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .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,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"
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 d244e0d

Please sign in to comment.