1
0
mirror of synced 2024-12-14 07:06:04 +03:00

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:
Benjamin Eberlei 2010-07-04 13:17:26 +02:00
parent d922631efe
commit fdf1f1b29e
4 changed files with 15 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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() {

View File

@ -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);