Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests to be able to finish it without a fatal error
Browse files Browse the repository at this point in the history
alquerci committed Apr 12, 2019
1 parent b4d3b6e commit 55526b8
Showing 6 changed files with 32 additions and 64 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tests/DoctrineTest/doctrine_tests/*
*TestCase.php
*TestCase.php
/tests/tmp
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,9 @@ php:
- hhvm
- nightly

services:
- mysql

matrix:
include:
- php: "5.3"
@@ -21,5 +24,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
@@ -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
24 changes: 19 additions & 5 deletions tests/ManagerTestCase.php
Original file line number Diff line number Diff line change
@@ -164,14 +164,28 @@ public function testDropDatabases()

public function testConnectionInformationDecoded()
{
$conn = null;
$thrownException = 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) {
$thrownException = $e;
}

if (null !== $conn) {
Doctrine_Manager::getInstance()->closeConnection($conn);
}

if (null !== $thrownException) {
throw $thrownException;
}
}
public function prepareData() { }
public function prepareTables() { }
16 changes: 0 additions & 16 deletions tests/tmp/Ticket_1527_User.php

This file was deleted.

40 changes: 0 additions & 40 deletions tests/tmp/generated/BaseTicket_1527_User.php

This file was deleted.

0 comments on commit 55526b8

Please sign in to comment.