[DDC-1091] Fix bug with custom string functions in StringPrimary
This commit is contained in:
parent
d0b95bb31c
commit
c53baa9935
@ -2308,7 +2308,8 @@ class Parser
|
||||
if ($peek['value'] == '.') {
|
||||
return $this->StateFieldPathExpression();
|
||||
} else if ($peek['value'] == '(') {
|
||||
return $this->FunctionsReturningStrings();
|
||||
// do NOT directly go to FunctionsReturningString() because it doesnt check for custom functions.
|
||||
return $this->FunctionDeclaration();
|
||||
} else {
|
||||
$this->syntaxError("'.' or '('");
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user