Skip to content

Commit dd78c1d

Browse files
committed
Added test case
1 parent 5e8b527 commit dd78c1d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/src/Rules/EntityQueryHasAccessCheckRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,11 @@ public function cases(): \Generator
9696
[__DIR__.'/data/bug-475b.php'],
9797
[]
9898
];
99+
100+
yield 'bug-494.php' => [
101+
[__DIR__.'/data/bug-494.php'],
102+
[]
103+
];
104+
99105
}
100106
}

tests/src/Rules/data/bug-494.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Bug494Example;
4+
5+
class TestClass {
6+
7+
public function bug494($entity_type): void
8+
{
9+
\Drupal::entityQuery($entity_type)
10+
->accessCheck(FALSE)
11+
->condition('field_test', 'foo', '=')
12+
->count()
13+
->execute();
14+
15+
\Drupal::entityQuery($entity_type)
16+
->condition('field_test', 'foo', '=')
17+
->accessCheck(FALSE)
18+
->count()
19+
->execute();
20+
21+
\Drupal::entityQuery($entity_type)
22+
->condition('field_test', 'foo', '=')
23+
->count()
24+
->accessCheck(FALSE)
25+
->execute();
26+
}
27+
}

0 commit comments

Comments
 (0)