Fix testsuite by re-ordering how tests are executed, added debug capabilities for SQL Global State problems using SQL Comments when DOCTRINE_MARK_SQL_LOGS phpunit configuration variable isset
This commit is contained in:
parent
d922631efe
commit
fdf1f1b29e
@ -57,8 +57,9 @@ class AllTests
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\PostgreSQLIdentityStrategyTest');
|
||||
|
||||
$suite->addTest(Locking\AllTests::suite());
|
||||
$suite->addTest(SchemaTool\AllTests::suite());
|
||||
$suite->addTest(Ticket\AllTests::suite());
|
||||
$suite->addTest(SchemaTool\AllTests::suite());
|
||||
|
||||
|
||||
return $suite;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ class AllTests
|
||||
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\SchemaTool\MySqlSchemaToolTest');
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\SchemaTool\PostgreSqlSchemaToolTest');
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\SchemaTool\DDC214Test');
|
||||
|
||||
return $suite;
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
namespace Doctrine\Tests\ORM\Functional\SchemaTool;
|
||||
|
||||
use Doctrine\ORM\Tools;
|
||||
|
||||
|
||||
require_once __DIR__ . '/../../../TestInit.php';
|
||||
|
||||
/**
|
||||
* WARNING: This test should be run as last test! It can affect others very easily!
|
||||
*/
|
||||
class DDC214Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
{
|
||||
public function setUp() {
|
@ -184,6 +184,14 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) {
|
||||
if (in_array($this->sharedFixture['conn']->getDatabasePlatform()->getName(), array("mysql", "postgresql"))) {
|
||||
$this->sharedFixture['conn']->executeQuery('SELECT 1 /*' . get_class($this) . '*/');
|
||||
} else if ($this->sharedFixture['conn']->getDatabasePlatform()->getName() == "oracle") {
|
||||
$this->sharedFixture['conn']->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual');
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->_em) {
|
||||
$this->_em = $this->_getEntityManager();
|
||||
$this->_schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this->_em);
|
||||
|
Loading…
Reference in New Issue
Block a user