Skip to content

Commit d636610

Browse files
brambaudmglaman
authored andcommitted
other tests that should fail too
1 parent 5ba2288 commit d636610

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/src/Type/data/entity-query-execute.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace DrupalEntity;
44

5+
use Drupal\node\NodeStorage;
56
use function PHPStan\Testing\assertType;
67
assertType(
78
'array<int, string>',
@@ -95,6 +96,30 @@
9596
->count();
9697
assertType('int', $query->execute());
9798

99+
$anotherTypedNodeStorage = \Drupal::entityTypeManager()->getStorage('node');
100+
if ($anotherTypedNodeStorage instanceof NodeStorage) {
101+
assertType(
102+
'array<int, string>',
103+
$anotherTypedNodeStorage->getQuery()
104+
->accessCheck(TRUE)
105+
->execute()
106+
);
107+
$query = $anotherTypedNodeStorage->getQuery()
108+
->accessCheck(TRUE);
109+
assertType('array<int, string>', $query->execute());
110+
assertType(
111+
'int',
112+
$anotherTypedNodeStorage->getQuery()
113+
->accessCheck(TRUE)
114+
->count()
115+
->execute()
116+
);
117+
$query = $anotherTypedNodeStorage->getQuery()
118+
->accessCheck(TRUE)
119+
->count();
120+
assertType('int', $query->execute());
121+
}
122+
98123
assertType(
99124
'array<string, string>',
100125
\Drupal::entityTypeManager()->getStorage('block')->getQuery()

0 commit comments

Comments
 (0)