Merge pull request #717 from hackedd/patch-1
Allow query parameters starting with an underscore
This commit is contained in:
commit
a53fe14fa2
@ -129,7 +129,7 @@ class Lexer extends \Doctrine\Common\Lexer
|
||||
'[a-z_\\\][a-z0-9_\:\\\]*[a-z0-9_]{1}',
|
||||
'(?:[0-9]+(?:[\.][0-9]+)*)(?:e[+-]?[0-9]+)?',
|
||||
"'(?:[^']|'')*'",
|
||||
'\?[0-9]*|:[a-z]{1}[a-z0-9_]{0,}'
|
||||
'\?[0-9]*|:[a-z_][a-z0-9_]*'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -158,6 +158,15 @@ class LexerTest extends \Doctrine\Tests\OrmTestCase
|
||||
$this->assertEquals(':name', $token['value']);
|
||||
}
|
||||
|
||||
public function testScannerRecognizesNamedInputParameterStartingWithUnderscore()
|
||||
{
|
||||
$lexer = new Lexer(':_name');
|
||||
$lexer->moveNext();
|
||||
$token = $lexer->lookahead;
|
||||
$this->assertEquals(Lexer::T_INPUT_PARAMETER, $token['type']);
|
||||
$this->assertEquals(':_name', $token['value']);
|
||||
}
|
||||
|
||||
public function testScannerTokenizesASimpleQueryCorrectly()
|
||||
{
|
||||
$dql = "SELECT u FROM My\Namespace\User u WHERE u.name = 'Jack O''Neil'";
|
||||
|
Loading…
x
Reference in New Issue
Block a user