Commit c8e4e7e7 authored by guilhermeblanco's avatar guilhermeblanco

Small changes to get Query tests running again.

Fixed wrong DQL in IdentifierRecognitionTest.php
parent d4e554fb
......@@ -70,7 +70,7 @@ class Orm_Query_IdentifierRecognitionTest extends Doctrine_OrmTestCase
public function testQueryParserSupportsMultipleAliasDeclarations()
{
$entityManager = $this->_em;
$query = $entityManager->createQuery('SELECT u.* FROM CmsUser u INDEX BY id LEFT JOIN u.phonenumbers p');
$query = $entityManager->createQuery('SELECT u.* FROM CmsUser u INDEX BY u.id LEFT JOIN u.phonenumbers p');
$parserResult = $query->parse();
$decl = $parserResult->getQueryComponent('u');
......@@ -94,7 +94,7 @@ class Orm_Query_IdentifierRecognitionTest extends Doctrine_OrmTestCase
public function testQueryParserSupportsMultipleAliasDeclarationsWithIndexBy()
{
$entityManager = $this->_em;
$query = $entityManager->createQuery('SELECT u.* FROM CmsUser u INDEX BY id LEFT JOIN u.articles a INNER JOIN u.phonenumbers pn INDEX BY phonenumber');
$query = $entityManager->createQuery('SELECT u.* FROM CmsUser u INDEX BY u.id LEFT JOIN u.articles a INNER JOIN u.phonenumbers pn INDEX BY pn.phonenumber');
$parserResult = $query->parse();
$decl = $parserResult->getQueryComponent('u');
......
<?php
require_once 'lib/mocks/Doctrine_DriverMock.php';
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
/**
* Base testcase class for all orm testcases.
......@@ -10,13 +11,13 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
{
protected $_em;
protected $_emf;
protected function setUp() {
if (isset($this->sharedFixture['em'])) {
$this->_em = $this->sharedFixture['em'];
} else {
$config = new Doctrine_Configuration();
$eventManager = new Doctrine_EventManager();
} else {
$config = new Doctrine_Common_Configuration();
$eventManager = new Doctrine_Common_EventManager();
$connectionOptions = array(
'driverClass' => 'Doctrine_DriverMock',
'wrapperClass' => 'Doctrine_ConnectionMock',
......
<?php
require_once 'lib/mocks/Doctrine_DriverConnectionMock.php';
require_once 'lib/mocks/Doctrine_DatabasePlatformMock.php';
// THIS FILE DOES NOT EXIST YET!!!!
//require_once 'lib/mocks/Doctrine_SchemaManagerMock.php';
class Doctrine_DriverMock implements Doctrine_DBAL_Driver
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment