Skip to content

Commit 02dd1bd

Browse files
committed
Test heredoc and nowdoc
1 parent f1f8b5e commit 02dd1bd

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/Rules/Doctrine/ORM/DqlRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public function testRule(): void
2929
'DQL: [Semantical Error] line 0, col 14 near \'Foo e\': Error: Class \'Foo\' is not defined.',
3030
44,
3131
],
32+
[
33+
'DQL: [Semantical Error] line 0, col 17 near \'Foo\': Error: Class \'Foo\' is not defined.',
34+
51,
35+
],
36+
[
37+
'DQL: [Semantical Error] line 0, col 17 near \'Foo\': Error: Class \'Foo\' is not defined.',
38+
59,
39+
],
3240
]);
3341
}
3442

tests/Rules/Doctrine/ORM/data/dql.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,20 @@ public function unknownEntity(): void
4646
)->getResult();
4747
}
4848

49+
public function heredoc(): void
50+
{
51+
$this->entityManager->createQuery(<<<DQL
52+
SELECT e FROM Foo
53+
DQL
54+
)->getResult();
55+
}
56+
57+
public function nowdoc(): void
58+
{
59+
$this->entityManager->createQuery(<<<'DQL'
60+
SELECT e FROM Foo
61+
DQL
62+
)->getResult();
63+
}
64+
4965
}

0 commit comments

Comments
 (0)