1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Small changes to get Query tests running again.

Fixed wrong DQL in IdentifierRecognitionTest.php
This commit is contained in:
guilhermeblanco 2008-09-13 06:34:47 +00:00
parent d4e554fb44
commit c8e4e7e7ab
3 changed files with 12 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class Orm_Query_IdentifierRecognitionTest extends Doctrine_OrmTestCase
public function testQueryParserSupportsMultipleAliasDeclarations() public function testQueryParserSupportsMultipleAliasDeclarations()
{ {
$entityManager = $this->_em; $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(); $parserResult = $query->parse();
$decl = $parserResult->getQueryComponent('u'); $decl = $parserResult->getQueryComponent('u');
@ -94,7 +94,7 @@ class Orm_Query_IdentifierRecognitionTest extends Doctrine_OrmTestCase
public function testQueryParserSupportsMultipleAliasDeclarationsWithIndexBy() public function testQueryParserSupportsMultipleAliasDeclarationsWithIndexBy()
{ {
$entityManager = $this->_em; $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(); $parserResult = $query->parse();
$decl = $parserResult->getQueryComponent('u'); $decl = $parserResult->getQueryComponent('u');

View File

@ -1,6 +1,7 @@
<?php <?php
require_once 'lib/mocks/Doctrine_DriverMock.php'; require_once 'lib/mocks/Doctrine_DriverMock.php';
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
/** /**
* Base testcase class for all orm testcases. * Base testcase class for all orm testcases.
@ -10,13 +11,13 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
{ {
protected $_em; protected $_em;
protected $_emf; protected $_emf;
protected function setUp() { protected function setUp() {
if (isset($this->sharedFixture['em'])) { if (isset($this->sharedFixture['em'])) {
$this->_em = $this->sharedFixture['em']; $this->_em = $this->sharedFixture['em'];
} else { } else {
$config = new Doctrine_Configuration(); $config = new Doctrine_Common_Configuration();
$eventManager = new Doctrine_EventManager(); $eventManager = new Doctrine_Common_EventManager();
$connectionOptions = array( $connectionOptions = array(
'driverClass' => 'Doctrine_DriverMock', 'driverClass' => 'Doctrine_DriverMock',
'wrapperClass' => 'Doctrine_ConnectionMock', 'wrapperClass' => 'Doctrine_ConnectionMock',

View File

@ -1,5 +1,10 @@
<?php <?php
require_once 'lib/mocks/Doctrine_DriverConnectionMock.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 class Doctrine_DriverMock implements Doctrine_DBAL_Driver
{ {