1
0
mirror of synced 2024-12-14 23:26:04 +03:00

Merge branch 'DDC-1091'

This commit is contained in:
Benjamin Eberlei 2011-05-01 11:01:39 +02:00
commit b5520aa304
2 changed files with 12 additions and 1 deletions

View File

@ -2308,7 +2308,8 @@ class Parser
if ($peek['value'] == '.') { if ($peek['value'] == '.') {
return $this->StateFieldPathExpression(); return $this->StateFieldPathExpression();
} else if ($peek['value'] == '(') { } else if ($peek['value'] == '(') {
return $this->FunctionsReturningStrings(); // do NOT directly go to FunctionsReturningString() because it doesnt check for custom functions.
return $this->FunctionDeclaration();
} else { } else {
$this->syntaxError("'.' or '('"); $this->syntaxError("'.' or '('");
} }

View File

@ -482,6 +482,16 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
$this->assertValidDQL('SELECT u, u.id + ?1 AS someNumber FROM Doctrine\Tests\Models\CMS\CmsUser u'); $this->assertValidDQL('SELECT u, u.id + ?1 AS someNumber FROM Doctrine\Tests\Models\CMS\CmsUser u');
} }
/**
* @group DDC-1091
*/
public function testCustomFunctionsReturningStringInStringPrimary()
{
$this->_em->getConfiguration()->addCustomStringFunction('CC', 'Doctrine\ORM\Query\AST\Functions\ConcatFunction');
$this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CC('%', u.name) LIKE '%foo%'", true);
}
/** /**
* @group DDC-505 * @group DDC-505
*/ */