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

[DDC-1757] test checks DQL only now, doesn't create schema anymore

This commit is contained in:
Aigars Gedroics 2012-04-17 10:57:31 +03:00
parent aa381951cd
commit 59e598acc5

View File

@ -8,20 +8,6 @@ require_once __DIR__ . '/../../../TestInit.php';
class DDC1757Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
protected function setUp()
{
parent::setUp();
try {
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1757A'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1757B'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1757C'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1757D'),
));
} catch(\Exception $ignored) {}
}
public function testFailingCase()
{
$qb = $this->_em->createQueryBuilder();
@ -36,18 +22,10 @@ class DDC1757Test extends \Doctrine\Tests\OrmFunctionalTestCase
$q = $qb->getQuery();
$dql = $q->getDQL();
try {
$data = $q->getResult();
self::assertEmpty($data);
} catch (\Doctrine\ORM\Query\QueryException $queryException) {
// Show difference between expected and actual queries on error
self::assertEquals("SELECT _a FROM " . __NAMESPACE__ . "\DDC1757A _a, " . __NAMESPACE__ . "\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d",
$dql,
"Wrong DQL query: " . $queryException->getMessage());
throw new \RuntimeException("Unexpected issue. DQL is correct but the query is failing.");
}
// Show difference between expected and actual queries on error
self::assertEquals("SELECT _a FROM " . __NAMESPACE__ . "\DDC1757A _a, " . __NAMESPACE__ . "\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d",
$dql,
"Wrong DQL query");
}
}